我需要获取计算机声音驱动程序的名称。把它放在一个列表或字符串中。我发现的只是“winmm.dll”的“int”返回方法,如“waveInGetDevCapsA”和“waveInGetDevCapsW”。
问问题
2792 次
1 回答
4
如果你想枚举音频设备,使用SlimDX变得非常容易。但是,它需要在计算机中安装 DirectX。
例如,要枚举音频捕获设备:
DeviceCollection coll = DirectSoundCapture.GetDevices();
foreach( DeviceInformation dev in coll ) {
...
}
枚举音频播放设备:
DeviceCollection coll = DirectSound.GetDevices();
foreach( DeviceInformation di in coll ) {
}
该类DeviceInformation
具有Description
type 的属性string
。它还具有DriverGuid
type 属性Guid
,使您能够“选择”设备以执行音频捕获或播放(也可以通过 SlimDX 完成)。
编辑:使用 Winmm.dll 的方法 请查看代码项目中的以下条目。它仅使用 Winmm.dll 构建枚举器。
希望这可以帮助!
于 2013-06-11T20:42:40.447 回答