Jump to content

Messagebeep


cid

Recommended Posts

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

 

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 1 year later...
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 :

                    

Link to comment
Share on other sites

 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);
-----------------------------------

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 1 month later...
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?

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 8 months later...

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

Link to comment
Share on other sites

  • 10 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...