Real time audio streaming library
I am looking to stream mic input from my android phone to a c# server. I am able to capture, and send the data fine to the c# server. My problem lies in playing that stream in real time on the server.
I cannot save to a file and read from it(as far as I know) because part of the header information for a wav file is开发者_开发百科 the size of it. So that won't work since it's constantly changing.
I have all available information to play the file(sample rates, channel count, audio format(pcm 16bit)).
Does anyone know of a library that can support this? Also, I am looking for a control that can be used in a winform to control the playback of this mic data if anyone knows of one.
Thanks in advance!
You can use the waveOutOpen
API (using PInvoke) to play "raw" sample data from streamed input. This family of API calls lets you open a playback device and then queue up sample buffers (of arbitrary length each) for playback.
You do not need to save the received audio chunks to disk before playing them - in fact, you don't want to do this unless you actually want a recording of the audio as well.
waveOutOpen
links:
http://www.koders.com/csharp/fidA53BE0F5147E80A51FAC4A7CA140B80436D056EC.aspx?s=waveoutopen
http://winmm.codeplex.com/
精彩评论