简体   繁体   English

如何在Windows 7中更改音频输出设备的默认共享模式采样率?

[英]How can I change audio output device default share mode sample rate in Windows 7?

I am using windows audio core api to do loopback-capture, and failed on this: // spClient is a smart comptr wrapped IAudioClient hr = spClient->Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_LOOPBACK,iRequestedDuration, 0, &m_struWaveFormat, 0); 我正在使用Windows Audio Core API进行回送捕获,并在此失败:// spClient是一个智能包装的IAudioClient hr = spClient-> Initialize(AUDCLNT_SHAREMODE_SHARED,AUDCLNT_STREAMFLAGS_LOOPBACK,iRequestedDuration,0,&m_struWaveFormat,0);

It returns AUDCLNT_E_UNSUPPORTED_FORMAT, because m_struWaveFormat is 44100,16bit format, but the configure in device property page is 48000,24bit format in share mode. 它返回AUDCLNT_E_UNSUPPORTED_FORMAT,因为m_struWaveFormat为44100,16位格式,但在共享模式下在设备属性页中的配置为48000,24位格式。 If I changed this to 44100, 16 bit format, the codes aboved runs well. 如果我将其更改为16位格式44100,则上述代码运行良好。 So, anybody can tell me how to change default share mode sample rate using audio core api please? 因此,有人可以告诉我如何使用音频核心API更改默认共享模式采样率吗? Thanks & Regards 感谢和问候

You can't change the shared mode sample rate using WASAPI. 您不能使用WASAPI更改共享模式的采样率。

WASAPI is very low level and supports only what the underlying device supports. WASAPI级别很低,仅支持基础设备支持的内容。 But even if the device supports your desired sample rate, only the administrator can change the shared mode sample rate by going into audio settings in the Control Panel. 但是,即使设备支持所需的采样率,也只有管理员可以通过进入“控制面板”中的音频设置来更改共享模式的采样率。

You may however want to take a look at the Windows Registry to see if there's anything you can tweak (assuming you're running with admin privileges). 但是,您可能需要查看Windows注册表,以查看是否有可以调整的内容(假设您以管理员权限运行)。 Stuff in the Control Panel is often just a front end to values in the Windows Registry. 控制面板中的内容通常只是Windows注册表中值的前端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM