mardi 29 avril 2014

Real time audio streaming to mobile device - dynamic playback speed


Vote count:

0




Here's the scenario:


I am using Nicecast (on OS X) to encode an MP3 stream (from microphone input), and sending it to an Ubuntu computer running Icecast2 streaming server. The streaming server is connected just to my LAN (not the internet) via Wi-Fi router. The stream is listened to by: iOS devices, Android devices, Windows Phones, Windows computers, Mac computers, etc. (most use VLC).


The latency from the microphone pickup to the audio playing through the client's speakers is about 1-2 seconds. This is ok for my application.


However, when there is network congestion (or the client's CPU is busy doing something else, or any number of reasons), the stream stops (breaks) for a few seconds, then when all is back to "normal", Icecast sends a blast of data to get caught back up to real time again. The client's buffer receives this blast of data and stores it (as it should) and starts playing again where it left off (which is also good, because it means no audio content was lost or missed, which is what I need for my application). But now the latency is about 4-5 seconds.


I need to keep the delay to around 1-2 seconds. So I thought if I could just speed up the playback to 1.5x, for example, after a few seconds, we'd be back to the 1-2 second latency. In other words, if buffer has 'x' amount of data in it, playback at 1.0x speed. If buffer reaches 'y' amount of data or more, playback at 1.5x speed until buffer is back to 'x' amount of data. A kind of "dynamic playback speed" (is there a better (or correct) name for this?).


So, my questions:



  1. Could I use VLC (client) to provide this solution?

  2. Are there other stream clients that could handle this well? (especially ones that work on multiple platforms)

  3. Or are there other streaming platforms that handle this automatically, or with a little configuration?


Any thoughts & comments would be much appreciated! Thanks!



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire