Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android stream audio to other devices

Hello I'm in the early stages of an app and part of it i need to stream audio from one device to multiple devices. I have been googling around looking for the best solution on doing this so far i found these two projects each with problems.

Spydroid http://code.google.com/p/spydroid-ipcamera/ Problem The problem with this one is it creates an rtsp stream which is limited to one connected device. If i browse to the link on both of my computers i see both clients connect in the app but then the second one to connect instantly disconnects and the app says my phone doesn't support this feature. I dove into the source and found in the Session.java file there were if statements with comments above them saying prevents two connections from being made i commented out the if statements and the catch clause caught me after running it. This project would be perfect if i could get it to work with multiple connections as it works over 3g.

PttDroid http://code.google.com/p/pttdroid/ Problem The problem with this one is it allows me the multiple connections i need but i only can get it working over wifi. It says on the home page there that it works over 3g but only the unicast i need multi cast over 3g and wifi and i was unable to get the unicast to work as well over 3g.

So my question comes down to this what path should i go down and look more into for streaming audio from my android device to multiple computers and other android devices.

Thank you very much for any help!

like image 759
user577732 Avatar asked Nov 13 '22 01:11

user577732


1 Answers

Cellular networks do not usually support multicast packets. The cellular routers simply don't route them, so that is a dead end.

You thus need to do unicast to multiple destinations which may be challenging for the limited cellular bandwidth of the phone. You are very likely to run into contention on the cellular bandwidth with just one or two streams, even if you can get them running out of the same device. (Multiple Spydroid streams of the same file for instance.)

If I were building a system to do this, I would consider setting up a server to do reflection. So I would look to use something like Spydroid to run an RTSP stream up to a server and then reflect that off the server to a number of subscribers. This is not a small project but would allow you to stream to multiple users using the servers higher bandwidth.

There is apparently a project going after this reflector strategy here: https://code.google.com/p/js4ms/wiki/RTSPMulticastReflector

I have not tested it at all to know if it works, but that should at least get you started on the right path.

like image 153
Nick Palmer Avatar answered Jan 10 '23 21:01

Nick Palmer