如何以编程方式更改默认声音播放设备?
如何以编程方式更改 vista 中播放和录制的默认音频设备?
是否有像Windows XP中的声音管理器那样的注册表设置?
哪个 API 可以实现?
How to change the default default audio device for playback and recording in vista programmatically ?
Is there any registry setting for it like sound manager in window XP?
Which API does it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
系统托盘音频设备切换器使用
“Software\Microsoft\Multimedia\Sound Mapper”、“Playback”
来设置通过枚举设备获得的声音设备的索引。还使用了“winmm.dll”中的mciSendCommand
在此源代码中,您将找到用于实现该目的的注册表项。
如果这不起作用,您可以尝试 进程监视器当您更改默认设备时监视 Windows 的所有注册表活动。在我的 Vista 安装中,控制面板会显示
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\"
对于 Vista,请参阅
http://www.vistaaudiochanger.com/
System Tray Audio Device Switcher uses
"Software\Microsoft\Multimedia\Sound Mapper", "Playback"
to set the index of the sound device which was obtained by enumeration the devices.mciSendCommand from "winmm.dll" is also used
In this source code you will find the registry keys used to achieve that.
If this doesn't work you could give Process Monitor a try and monitor all registry activities of windows when you change the default device. On my Vista installation the control panel twiddles with
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\"
For Vista see
http://www.vistaaudiochanger.com/
没有公共 API 允许您更改默认音频设备,该功能被认为是在用户控制之下。 Windows 中一直都是这样。
话虽如此,如果您在网上搜索,就会发现有很多人对 Windows Vista 中使用的 API 进行了反向工程来执行此操作,但我不会向您指出他们(反向工程 API 是内部的)不受支持的 API,并且可能会更改,恕不另行通知 Microsoft)。使用这些解决方案的风险由您自行承担。
There is no public API which allows you to change the default audio device, that is functionality that is considered to be under the users control. This has always been the case in Windows.
Having said that, if you search the web, there are a number of people who have reverse engineered the APIs that are used in Windows Vista to do this, but I'm not going to point you to them (the reverse engineered APIs are internal unsupported APIs and may change without notice from Microsoft). You use these solutions at your own peril.
我真的不知道是否有人还需要这个,但这是我的解决方案。
实际上,它是用于捕获设备的,但它可以轻松更改为渲染设备。
它将设备密钥中的 3 个注册表值设置为当前时间。很神奇,但这就是它的工作原理。
注意:仅在 Win7 x64 上测试
I really don't know if anyone still needs this, but here is my solution.
Actually, it's for the capture device, but it can be changed easily to the render device.
It sets 3 registry values in the device's key to the current time. Magic, but that's how it works.
Note: only tested on Win7 x64