使用 C 在 Windows 中捕获麦克风音频流

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1897042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:34:59  来源:igfitidea点击:

Capture microphone audio stream in Windows using C

cwindowsaudiomicrophone

提问by Mark Elliot

I'm looking to build a Morse decoder (and eventually a coder) in C. I'd like to use the audio port as input, and sample the incoming voltage on the port.

我希望在 C 中构建一个 Morse 解码器(最终是一个编码器)。我想使用音频端口作为输入,并对端口上的输入电压进行采样。

How do I go about reading the voltage on a microphone audio port in Windows using C?

如何使用 C 在 Windows 中读取麦克风音频端口上的电压?

回答by Frank Krueger

The simplist way is to use the waveInfunctions provided by the Win32 API.

最简单的方法是使用Win32 API 提供的waveIn函数。

You can read Recording and Playing Sound with the Waveform Audio Interfacefor an overview, or just dive into the API documentation.

您可以阅读使用波形音频接口录制和播放声音以获取概述,或者直接深入了解API 文档