【发布时间】:2011-05-26 00:16:44
【问题描述】:
我在 SO 上找到了this 有关如何使用 .NET 枚举声音设备信息的信息,但我真的不知道如何在 Python 中使用这些信息。正如您可能知道的那样,我对 Windows API 编程的经验几乎为零。
我可以弄清楚如何通过 WMI 获取基本信息,但我需要更多信息,看起来可能下面的 C# 代码 sn-p 是我需要的,但我只是不知道如何访问 DirectSound 对象来自 Python。我已经用 ctypes 找到了一些基本的东西,但我不知道加载哪个或如何加载 DirectX .dll...
DevicesCollection devColl = new DevicesCollection();
foreach (DeviceInformation devInfo in devColl)
{
Device dev = new Device(devInfo.DriverGuid);
//use dev.Caps, devInfo to access a fair bit of info about the sound device
}
任何指针?
【问题讨论】:
-
您使用的是哪种 Python? IronPython 对吗?
-
我目前正在使用 CPython,但如果需要,我可以毫无问题地切换到 IronPython。