Extension: UDP audio Chat. Voice. WiFi. Send sound over UDP

1.- UDP audio Chat. WiFi. Send sound over UDP.

Through this extension we can send audio from one mobile to another, using UDP. WiFi.

- Blocks.
extension_udp5

- Example:

p299J_Voz_UDP.aia (12.1 KB)

- Designer.

- Blocks.

6 Likes

2.- Send and receive audio to the same device.

  • To do the first test we run the application (it works in MIT Companion). We get the IP of the device, in my case: 192.168.1.2

  • We write that IP in "To IP". We establish the same port to send and receive, in this case: 4444

  • We activate the Microphone and the Speaker. We speak in front of the mobile and we must listen to our voice.

  • To avoid sound feedback it is advisable to use an earphone.

  • In this example the application is sending and receiving the sound.

extension_udp2

1 Like

3.- Chat with two mobiles.

  • In each mobile we put the IP and the port of the other mobile ("To IP" and "To Port"), we also establish the port through which we will receive the audio.

2 Likes

4.- Broadcast.

  • If instead of establishing the IP of a device, we write To IP: 255.255.255.255 the sound will be sent to the entire network, and it will "enter" those devices that have port 4444 (in this example) activated with UDP.

4 Likes

5.- Credits.

  • The code to Get the Local IP is an adaptation of...

http://www.java2s.com/example/java-api/java/net/networkinterface/getnetworkinterfaces-0-1.html

2 Likes

Cool! But is there a way to use a mp3 file as input instead of microphone? I'd like to do something like phone-bot for my home

The easiest answer would be to send the .mp3 file

send mp3 as text and then playback it at remote device?

One idea would be to convert the file to Base64 and send it using UDP, I haven't tried it with large files.

http://kio4.com/appinventor/277_extension_imagen_string.htm

these files wont be large. just some tts speech

Try

i want use in network wan over internet not in lan, one idea

I haven't tried it, but maybe opening the port of a local network (NAT) can be achieved.

I did it

125kb file is too large even when at base64 (it isnt sending)

edit: 64kb is still too big

what did you do to achieve this?

What he said @Juan_Antonio i did it, i mounted server and not found the devices

ok, i interpreted your "I did it" as success

Another idea would be to install an FTP server on a PC.