如何在 C++ 中从麦克风获取 PCM 数据(Windows 操作系统)?

发布于 2024-08-23 15:06:33 字数 59 浏览 2 评论 0原文

我需要用 C++ 从麦克风捕获 PCM 数据。

我是初学者。

怎么做呢?

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

I'm a beginner.

How to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

流绪微梦 2024-08-30 15:06:33

您可以使用 waveInOpen() 来执行此操作和 waveInStart() API 函数。这里有一个示例项目可用。

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

暖树树初阳… 2024-08-30 15:06:33

查看综合工具包。他们有一个名为 RtAudio 的类,可以在多个平台上运行,包括 Windows、OS X 和 Linux。除了为您提供 PCM 数据之外,还可以选择生成您自己的数据、处理数据并将其保存为标准文件格式。

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.

星軌x 2024-08-30 15:06:33

这取决于您想如何处理数据。如果您只想进行捕获而不进行任何特殊处理,那么您需要一些基本且易于使用的库,例如:

  • 媒体控制接口
  • 波形音频

如果您打算进行一些音频处理,那么您可能应该看看:

  • DirectSound
  • OpenAL
  • DirectShow
  • Windows 核心音频
  • XAudio2

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文