How to get PCM data from microphone in C++ (os Windows)?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 09:31:39

问题


I need to capture PCM data from microphone in C++.

I'm a beginner.

How to do it?


回答1:


You can do this with the waveInOpen() and waveInStart() API functions. There's a sample project available here.




回答2:


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.




回答3:


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


来源:https://stackoverflow.com/questions/2351659/how-to-get-pcm-data-from-microphone-in-c-os-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!