如何在Vista中设置默认音频设备 [英] How can I set default audio device In Vista

查看:277
本文介绍了如何在Vista中设置默认音频设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我有一个必须尽快解决的问题,不幸的是,我一直在寻找大量信息并发布在许多论坛中,这仍然没有解决.
我可以使用IMMDeviceEnumerator :: GetDefaultAudioEndpoint函数获取默认的渲染端点设备,并通过其他接口获取所有端点,但是我没有找到类似于"SetDefaultEndpoint"的函数,我无法在程序中更改默认端点设备,如何通过代码在Vista中设置默认音频设备?
谢谢.

Hello,
I have a problem must to be resolved soon, I have looked for a lot of information and published in many forums, unfortunately, that is still not resolved .
I can get default render endpoint device by using IMMDeviceEnumerator::GetDefaultAudioEndpoint function, and get all endpoint by using other interface, But I did not find such a function similar to "SetDefaultEndpoint", I can not change default endpoint device in my program, How to set default audio device in vista by code?
Thanks.

推荐答案



Microsoft不提供用于设置默认音频设备的编程方法.您可能可以直接操纵注册表来更改默认音频设备.在Windows XP及以下版本上,以下各项将起作用:

使用VC ++通过编程方式更改Windows音频设备 [ http://eretik.omegahg .com/download/DefSound.rar [ ^ ]

最好的祝福,
-大卫·德劳恩(David Delaune)
Hi,

Microsoft does not provide a progmatic method for setting the default audio device. You could probably manipulate the registry directly to change the default audio device. On Windows XP and below the following will work:

Changing your Windows audio device programmatically using VC++[^]

On Vista and above the registry key is located at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio

There is an undocumented/unsupported COM interface IPolicyConfig which is demonstrated here: http://eretik.omegahg.com/download/DefSound.rar[^]

Best Wishes,
-David Delaune


这篇关于如何在Vista中设置默认音频设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆