如何以编程方式更改默认的音频输入设备

如何以编程方式更改默认的音频输入设备

问题描述:

我要寻找一种方法来设置/更改默认的输入设备,我的应用程序中。我有几个不同的录音设备,这是很是烦人进入控制面板,并更改默认的录音设备。我环顾四周,我没有发现任何东西,可以帮助我的问题。应用程序是用C#和它的目标是为Windows Vista / Windows 7操作系统。

I am looking for a way to set/change default input device inside my application. I have several different recording devices and it is very anoying to go into the control panel and change default recording device. I was looking around and I did not find anything that could help me with the problem. Application is written in c# and it is targeted for Windows Vista / Windows 7.

有没有公共API来做到这一点在Vista中/ 7 AFAIK。

There is no public API to do this in Vista/7 AFAIK.

有关我创建了一个媒体中心推出的东西,我只好打开控制面板和按键发送到对话框,一个很大的丑陋的黑客攻击,但它是最好的,你可以做。 (或者直接在媒体中心.NET反射器(它是能够改变它,使用无证话费))

For a media center launch thing I created, I had to open the control panel and send keys to the dialog, a big ugly hack, but it's the best you can do. (Or run .net reflector on media center (It is able to change it, using undocumented calls))