如何动态选择音频设备?
我和我的一个朋友进行了交谈,并意识到 Windows 7 的每个应用程序音频设置缺少一个关键组件。您可以设置音量,但无法规定每个应用程序应使用哪个设备。
某些应用程序(例如 ventrilo 或 Skype)允许您选择要使用的设备,但是,大多数应用程序仅依赖于当前的“默认音频设备”。
有办法访问这个吗?什么语言最适合公开这些类型的函数?谢谢!
A friend of mine and I got into a conversation and realized Windows 7 is missing a key component to its per-application audio settings. You can set volume but you can't stipulate which device each application should use.
Some applications such as ventrilo or skype allow you to select which device to use however, MOST applications simply rely on the current 'Default Audio Device.'
Is there a way to access this? What language would be best used to expose these kinds of functions? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ventrilo 和 Skype 能够选择使用哪个音频设备,因为它们被编码为直接指定音频输出设备,而不是仅从操作系统获取默认设备。对于编码为使用默认 Windows 设备的应用程序,您当然可以使用声音设置更改哪个设备是默认设备,但这将更改整个系统的默认设备。
Windows 不一定支持为全部使用默认音频设备的单独应用程序设置不同的音频设备,并且许多应用程序使用 DirectSound API,这使情况进一步复杂化。但是,某些应用程序在初始化时会检查哪个设备是默认设备,然后专门输出到该设备。在这种情况下,您可以将默认声音设备更改为一个音频设备,启动一个程序,然后将默认声音设备更改为另一个音频设备,第一个程序将继续使用启动时的默认设备。
然而,这是一个相当弱的解决方法,并且仅适用于以上述方式编码的特定应用程序。
Ventrilo and Skype are able to choose which audio device to use because they are coded to directly specify audio output devices instead of just getting the default from the OS. For applications which are coded to use the default Windows device, you can of course change which device is the default device using the sound settings, but this will change the default for the whole system.
Setting different audio devices for separate applications which all use the default audio device isn't something that is necessarily supported by Windows, and many applications use the DirectSound API which complicates the situation further. However, some applications check which device is the default when they initialize and then output exclusively to that device. In this case, you could change the default sound device to one audio device, start a program, then change the default to another audio device, and the first program would continue to use the device which was default when it started up.
However, this is a pretty weak workaround and will only work for specific applications which have been coded in the way described above.