How to get PCM data from microphone in C++ (os Windows)?
I need to capture PCM data from microphon开发者_如何学JAVAe in C++.
I'm a beginner.
How to do it?
You can do this with the waveInOpen() and waveInStart() API functions. There's a sample project available here.
Check out The Synthesis Toolkit. They have a class called RtAudio that works on multiple platforms including Windows, OS X, and Linux. Beyond just giving you the PCM data, there are options for generating your own data, processing the data, and saving it to a standard file format.
It depends what you want to do with your data. If you just want to do capturing without any special processing then you would need some basic and easy to use libraries such as:
- Media Control Interface
- Waveform Audio
If your intention is to do some audio processing then you should probably take a look at:
- DirectSound
- OpenAL
- DirectShow
- Windows Core Audio
- XAudio2
精彩评论