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.

4 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