This project has moved. For the latest updates, please go here.

VoIP streaming?

Feb 2, 2010 at 8:56 PM

Hi guys,

Im trying to implement a little VoIP software, nothing special, just UDP stream between 2 computers. I found the NAudio lib, witch was very helpful in the first place... i can easily capture, and play sound.

BUT: now im trying to rebuild that and want to make a "live" stream. i think the best attempt was this:

Capturing -> OnDataAvailable : send the buffer as it is on the network. the receiver is waiting for packets and gets it. but he is not able to play it now as there is no wave-header.

i tried this with the waveformat new WaveFormat(8000, 8, 1); i know its not the best, but i dont think that the format is the reason for this problem.

i experimented with a lot of workarounds, but in the end im helpless, anybody has an idea?

thanks in advance

 

Feb 4, 2010 at 8:44 AM

Hey, you are not allowed to let the playback device wait for packets. If no packets are available you have to return an empty (all zeros) buffer. Keeping that in mind it is necessary to buffer the packets on the receiving side since you have to handover packets from the network thread to the playback thread.

Chris

Feb 5, 2010 at 4:13 PM

I'm working on a similar issue, trying to play audio from VoIP RTP streams.  I was able to play raw data by deriving a new class from WaveStream and placing the RAW data into a memory stream.  My audio is encoded as G711u so I just used the build in decoder.