cid Posted May 24, 2020 Posted May 24, 2020 Hola La función beep o messagebeep(), funciona correctamente en local pero en modo web o movil no, habria alguna forma de invocar a los sonidos de sistema ? reproducir un wav funciona pero con bastante retardo y para esta aplicación no me sirve Gracias Quote
Sherzod Posted May 24, 2020 Posted May 24, 2020 Hello, Also, you can use the HTML <audio> tag: https://www.w3schools.com/tags/tag_audio.asp Quote
cid Posted May 25, 2020 Author Posted May 25, 2020 Gracias por contestar, Sherzod Por si le sirve a alguien, al final he utilizado el siguiente código: UniSession.AddJS('a=new AudioContext();'+ ' v=a.createOscillator();'+ ' u=a.createGain();'+ ' v.connect(u);'+ ' v.frequency.value=440;'+ //frecuencia ' v.type="square";'+ ' u.connect(a.destination);'+ ' u.gain.value=30*0.01;'+ //volumen ' v.start(a.currentTime);'+ ' v.stop(a.currentTime+200*0.001);'); //duracion Quote
Sherzod Posted May 25, 2020 Posted May 25, 2020 3 minutes ago, cid said: Por si le sirve a alguien, al final he utilizado el siguiente código: Oh, great! Quote
asapltda Posted October 2, 2021 Posted October 2, 2021 On 5/25/2020 at 4:43 AM, cid said: Gracias por contestar, Sherzod Por si le sirve a alguien, al final he utilizado el siguiente código: UniSession.AddJS('a=new AudioContext();'+ ' v=a.createOscillator();'+ ' u=a.createGain();'+ ' v.connect(u);'+ ' v.frequency.value=440;'+ //frecuencia ' v.type="square";'+ ' u.connect(a.destination);'+ ' u.gain.value=30*0.01;'+ //volumen ' v.start(a.currentTime);'+ ' v.stop(a.currentTime+200*0.001);'); //duracion Good evening, if the instruction was written in a tunimmemo to be able to try different sounds. as I must encode the submitted soluccion, example : procedure TMainmForm.UnimButton3Click(Sender: TObject); var s:string; begin s:= QuotedStr(UnimMemo1.Text ); UniSession.AddJS(s ); //duracion end; Buenas noches, si la instruccion se escribiera en un tunimmemo para poder probar diferentes sonidos. como debo codificar la soluccion enviada, ejemplo : Quote
Sherzod Posted October 2, 2021 Posted October 2, 2021 29 minutes ago, asapltda said: if the instruction was written in a tunimmemo to be able to try different sounds. as I must encode the submitted soluccion Could you please explain in more detail? Quote
asapltda Posted October 2, 2021 Posted October 2, 2021 Thanks for your interest sr, the problem was bad writing of the code in tunimemo component attached the correct contedido in case someone has the same problem. ------------- a=new AudioContext(); v=a.createOscillator(); u=a.createGain(); v.connect(u); v.frequency.value=1200; v.type="square"; u.connect(a.destination); u.gain.value=60*0.01; v.start(a.currentTime); v.stop(a.currentTime+300*0.001); ----------------------------------- Quote
asapltda Posted October 2, 2021 Posted October 2, 2021 Good Morning Mr Sherzod, I have tried to emit sound and it works correctly on the desktop, but when you test the sound emission on the mobile the sound is played, but it only accepts 10 sound emissions. This sound emission is made to count inventory units by reading the bar code of the product and thus identify if the product is correct by emitting the sound. two types of sounds one of correct and one of incorrect, but the count can easily reach 500 readings, is there a restriction ? I'm using unigui for mobiles. or a buffer or queue of the java scrip is required thank you for your interest Quote
asapltda Posted October 2, 2021 Posted October 2, 2021 10 minutes ago, asapltda said: Good Morning Mr Sherzod, I have tried to emit sound and it works correctly on the desktop, but when you test the sound emission on the mobile the sound is played, but it only accepts 10 sound emissions. This sound emission is made to count inventory units by reading the bar code of the product and thus identify if the product is correct by emitting the sound. two types of sounds one of correct and one of incorrect, but the count can easily reach 500 readings, is there a restriction ? I'm using unigui for mobiles. or a buffer or queue of the java scrip is required used procedure memo1= a=new AudioContext(); v=a.createOscillator(); u=a.createGain(); v.connect(u); v.frequency.value=1200; v.type="square"; u.connect(a.destination); u.gain.value=60*0.01; v.start(a.currentTime); v.stop(a.currentTime+300*0.001); ----------------------------------- procedure TMainmForm.UnimButton3Click(Sender: TObject); var s:string; begin s:= (UnimMemo1.Text ); UniSession.AddJS(s ); end; 10 minutes ago, asapltda said: thank you for your interest Quote
asapltda Posted November 9, 2021 Posted November 9, 2021 Good evening, any comment that you can only make 10 sound broadcasts? Thank you Quote
Sherzod Posted November 9, 2021 Posted November 9, 2021 3 hours ago, asapltda said: any comment that you can only make 10 sound broadcasts? Hello, Sorry for the late reply. Can you make a test case to check the difference between the program's work in a desktop application and in a mobile application? Quote
asapltda Posted December 13, 2021 Posted December 13, 2021 Create the use case with unigui desktop. On the desktop it can emit many times the sound( >15), but on the mobile it only emits 10 / 11 times the sound and remains silent. the solution to this problem is very important and that I would have to migrate much of the application to delphi firemonkey, Thank you for your attention. Using unigui for mobile has the same problem note source and exe EmitirSonidosDeskTop.rar EmitirSonidoDesktop.zip Quote
asapltda Posted August 31, 2022 Posted August 31, 2022 Good afternoon about my query to only emit a few sounds is there any solution ? Thank you Quote
Sherzod Posted September 1, 2022 Posted September 1, 2022 6 hours ago, asapltda said: Good afternoon about my query to only emit a few sounds is there any solution ? Thank you Hello, Do you have a test case for the mobile version as well? Quote
asapltda Posted September 1, 2022 Posted September 1, 2022 Good afternoon about my query to only emit a few sounds is there any solution ? Thank you Good morning, in this example for movile, on the desktop you can stop the sound emission after 50 whistles, on the cell phone sometimes it happens after the emission 10 or more. Good morning, in this example for mobiles, on the desktop you can stop the sound emission after 50 whistles, on the cell phone sometimes it happens after the emission 10 or more. It seems that it is also affected by the speed with which the emission of sounds is indicated which is fast. the task that is done is to read bar codes Emitir Sonidos2.rar Quote
Sherzod Posted September 1, 2022 Posted September 1, 2022 1 hour ago, asapltda said: Good afternoon about my query to only emit a few sounds is there any solution ? Can you test this example too? Quote
asapltda Posted July 27, 2023 Posted July 27, 2023 Good evening, the problem persists, you can only repeat the code that emits the sound 10 to 20 times and you want to repeat n times. This happens for both desktop or mobile, ? will it be that some queue is filled? Quote
Sherzod Posted July 27, 2023 Posted July 27, 2023 On 9/1/2022 at 7:05 PM, asapltda said: Emitir Sonidos2.rar 66.22 kB · 3 downloads Hello, You shouldn't use the AudioContext in this way. See my example above... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.