Android Question Streaming mic audio over wifi direct

Devv

Active Member
Licensed User
Longtime User
What would be the simplest method to steam audio from (device 1) microphone to (device 2) speaker over wifi direct ?

Is there is any already made examples ?
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Search for the walkie talkie example...
This may give you an start. Maybe
 
Upvote 0

Devv

Active Member
Licensed User
Longtime User
Search for the walkie talkie example...
This may give you an start. Maybe
Indeed the walkitalki example is exactly what i wanted, except that the both devices have to be connected to a router (for me it did not worked when i made a portable wifi hotspot from one of the mobiles)

any ideas ?
 
Upvote 0

Devv

Active Member
Licensed User
Longtime User
Upvote 0

stevel05

Expert
Licensed User
Longtime User
so it is not possible to be done using the walki talki method (that Donmanfred suggested) ?

I don't know, I haven't tried it. If you post the project you have tried, we will be able to test it out and see. Or someone may have already done it and can tell you how.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It doesn't appear that you can connect via wifi to a hotspot on the same device. Which does seem to make sense.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It does work over bluetooth though, perhaps you could use that instead.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I don't think you will be able to do it over wifi without a router of some description, websockets will require an IP address too.
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
WebSockets won't accomplish what you want as you'll need a server. The B4A WebSocket library is client-only. You should be able to accomplish what you want using the walkie-talkie example but instead of using WiFi or Bluetooth, use WifiDirect.

In the walkie-talkie example, you feed the AsyncStreams object an InputStream and an OutputStream. When you use WiFi, these streams come from the Sockets you are using over WiFi. When using Bluetooth, these streams come from Serial object used to manage the Bluetooth connection. In order to use WiFiDirect, just supply AsyncStreams with the InputStream and OutputStream you get from the WiFiDirect library (after having established a connection). That's the great thing about Asyncstreams; they are connection-agnostic. So long as it gets an InputStream and an OutputStream, it will work, regardless of the connection.
 
Upvote 0
Top