开发者

How can I capture audio from a mic to send it over a socket?

I am using Windows 7 and developing a chat-like application with Visual Studio 2010. I am looking for an EASY way of capturing audio from a microphone (or rather, from the default recording device), collect the buffer from said input, and send it over a socket. I've seen DirectX solutions recommended, but from my research that is quite the opposite of simple. 5000 lines of sample code for a simple capture/save file program? That simply doesn't work for me (and yes, that was an official sample provided with the SDK).

Anyway, I don't need it to be cross-platform, and I would really prefer something that already comes with Windows, though I don't mind installing a library as long as it doesn't take longer than writing the hardware drivers from scratch to figure it out (exaggeration). I've heard of this waveInOpen function, but oddly enough I cannot find any demos on how to use it. If anyone has an idea or a link to some sample code, I would greatly appreciate it. Thanks everyone for your time!

P.S. I can figure out the networking part myself. I just need access t开发者_如何转开发o the raw audio data buffer.


If you're doing the sockets yourself try checking out:

http://www.techmind.org/wave/

http://www.bcbjournal.com/articles/vol2/9810/Low-level_wave_audio__part_3.htm

http://www.relisoft.com/freeware/recorder.html

I enjoyed all of them but the last one, but then again, you might find it far more helpful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜