Best approach for user to user audio communication
For one of my projects I need users to be able to communicate with each other in an audio mode. The thing I'm concerned about is the scalability of the project if it even gets big in terms of bandwidth consumption.
What are the alternatives to passing the audio through my server to the users?
Is it possible to create a link between two users so they can exchange their stream of data (audio in this case) so that it doesn't pass through me, while still being able to control the time they've been connected to each other and some other information?
As for now it's just an idea I have in mind but I don't really know what to look into. I think it will probably need to be some plugin dependa开发者_Go百科nt solution so that's why I tagged the question like that.
I'm not looking for a concrete solution, just a little push in the right direction from someone who has been through something similar.
Thanks!
You certainly can keep the audio data off your server, and yes you'd have to do this to get any sort of scalability.
Telecommunications networks have long worked this way, splitting the signalling traffic from voice traffic. See the SS7 architecture, the IMS architecture.
If your project is internet based, it sounds like a typical VoIP approach would fit well.
Here are a few general approaches:
- All signalling and voice traffic goes direct through the same server(s) (this won't scale!)
- Signalling goes through your server(s), and voice traffic goes through dedicated servers (scales very well -- typical approach in telco)
- Signalling goes through your server(s), and voice traffic goes direct from user to user via a TCP/IP connection (scales well, and now you only have to provide the signalling server)
- Signalling goes through your server(s), and voice traffic goes through a world-wide mesh of connected users running your software (scales super well, and you're now competing with Skype!)
If you're talking voice traffic, then you'd also want to use audio compression specific to speech, since speech can be compressed heavily which remaining intelligible, and this helps limit bandwidth consumption at the user end.
If you're in a browser environment, one hurdle may be how to get peer-to-peer connectivity between users in general, and keep it secure. New web technologies like Web Sockets are worth looking into here. But for this particular issue, asking something like "how to get peer-to-peer connectivity in a web app" could yield helpful answers.
精彩评论