c# capture microphone
Can someone tell me how could I capture the microphone a开发者_如何学编程nd send it over IP? Is there any example of how to capture and put into a buffer in order to send it on UDP socket to another computer and listen the song? I'm working in c#. THX. I would really apprecciate if there is someone who can give me an example:)
you can find some open source projects you could get inspired from: http://www.voip-info.org/wiki/view/Open+Source+VOIP+Software
if you just want to stream audio via UDP maybe you don't need a full implementation of the SIP stack but if you want to make a skype-clone you probably do.
Since you're transferring music and not speech I recommend Vorbis as codec and not Speex. There are some C# wrappers available. Vorbis has higher latency and bandwidth than Speex, but Speex only works well for speech and not for music.
Mine is available on github: https://github.com/CodesInChaos/Xiph
It also includes a wrapper to the noise suppression of the speex pre-processor. But I've never tried it on music.
Is there any reason why you want UDP? If latency isn't very important I'd just use TCP instead.
To get the audio you can use NAudio, or as I did the code from http://www.codeproject.com/KB/cs/Streaming_wave_audio.aspx
精彩评论