Extension: ToneGenerator. BEEP. Frequency - Duration

ToneGenerator Extension:

Android has several tones that can be generated indicating an integer, for example: TONE_CDMA_ABBR_ALERT corresponds to number 97.

You can see it in:
https://developer.android.com/reference/android/media/ToneGenerator.html

In this extension the user sets a number for the tone type and a duration in milliseconds.

You can also set a frequency in hertz and a duration in milliseconds.

  • Here an example:

Regards.

Tonos.txt (2.5 KB)
com.KIO4_Tone.aix (6.0 KB)
p139B_Extension_Sonido.aia (8.4 KB)

  • Esta extensión es un Generador de tonos, en el bloque denominado Type puedes escribir un número según el tono que quieras que suene en la aplicación, los números correspondientes a cada tono lo puedes ver en el archivo Tonos.txt.
    En el Bloque Frecuency, puedes poner una frecuencia en Hercios, sonará un tono con esa frecuencia.

  • En los dos bloques se ha de poner la duración del tono.

Juan Antonio Villalpando.

http://kio4.com/appinventor

12 Likes

very good extension!thank you Juan.

Felicitaciones muy buen trabajo

Very nice extension. I like to experiment with sound.
I got this error message when playing the freq method with a button and I went a little faster. Is it a limitation that you can’t play the tones too fast or is something you can fix?

Gracias Italo,

it is a limitation of code, you can’t press too fast.

Hay una extensión muy buena, si usted crea una extensión para tal protocolo infrarrojo (telecontrol), entonces mi 1 proyecto será terminado. O sugiere alguna forma de tales extensions. Serás muy amable
infra-red protocol (remote) without ir blaster

Thank you Shivendra_Kr_Sahu,

It is interesting the transmission by IR, but at the moment I am occupied in other works.

BTW, if your mobile does not have IR you can connect these devices:
http://kio4.com/appinventor/606_movil_infrarojo.htm

thank u dear Juan_Antonio.
hardware !!! no problem for me .
if possibly guide me about inventor code
thank u

Is it possible to generate rf signal for example 433MHZ with this extension. I wish to wirelessly switch an rf relay.

1 Like

433MHz is U.H.F. and this extension only creates audio frequency.

Hello,
How can i stop sound when it is begin to play. For example i set duration 10 seconds but i want to stop it. it there anyway to stop or am i have to wait until duration

Hi, while using this extension after 15 th click Runtime error (init failed)message is coming.I used DTMF tone generator by calling tone type and duration 200ms

Please help