c++ - 修改系统卷后如何修改WASAPI回送捕获卷?

标签 c++ windows audio loopback wasapi

我正在将WASAPI与回送捕获模式一起使用,以记录Windows 10笔记本电脑声卡的音频。我在这里遵循了示例:https://docs.microsoft.com/en-us/windows/win32/coreaudio/capturing-a-stream,它可以完美运行。

但是,当我使计算机静音或向上或向下滑动音量时,录音的音量不会改变。我希望它相应地更改并相应地静音,而不是总是播放。我已经研究过通过Activate函数(https://docs.microsoft.com/en-us/windows/win32/api/mmdeviceapi/nf-mmdeviceapi-immdevice-activate)将IAudioEndpointVolume添加到我的IMM_Device(已经通过IAudioClient3激活了),但是代码现在在Initialize调用时崩溃。

有人能做到吗?关于从现在起去哪里有什么建议?

非常感谢!

最佳答案

However, when I mute the computer, or slide the volume up or down, the volume of the recording does not change.



Volume Controls

As explained in Audio Sessions, Sndvol is the system volume-control program. It displays volume controls for the audio-rendering endpoint devices in the system. (Currently, it does not display the volume controls for audio-capture endpoint devices.) To view the volume controls for a particular device, click Device in the menu bar and select a device name from the list of available devices.



也许问题出在这里。您静音音频渲染,而不是音频捕获。

关于c++ - 修改系统卷后如何修改WASAPI回送捕获卷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60358070/

相关文章:

iphone - 在自己的应用程序中使用 iPhone 音频文件 - 复制音频文件 - 这可能吗?

ipad - iPad Safari <audio>无法播放

c++ - shared_ptr 的 dtor 是否需要使用 "deleter"?

c# - 识别 C# 应用程序使用的 native 内存的所有者

windows - 在 Windows 上对 HTTPS URL 运行 wget 时如何修复证书错误?

c++ - 是否可以忽略 UnMapViewOFFile() 的错误 487 (ERROR_INVALID_ADDRESS)?

python - 如何从内存中播放 Wav 声音样本

c++ - 在多线程环境中将局部变量作为常量引用传递

c++ - 如何正确接收组播UDP包?

c++ - 如何将派生对象放置到 map 中