2011-03-24 74 views
0

我有一个在Windows XP上编译的程序,现在我试图在Windows 7(x86和x64)上运行它。该程序使用DirectSound8来枚举机器上的所有声音设备。问题是,枚举函数返回DirectSoundEnumerate(...)在Windows XP和Windows 7的DirectSoundEnumerate()不会在Windows 7上列出驱动程序名称

 
Windows XP 
Device GUID = 
Device description = Primary Sound Driver 
Driver name = 

Device GUID = {bd6dd71a-3deb-11d1-b171-00c04fc20000} 
Device description = SigmaTel Audio 
Driver name = sthda.sys 

Windows 7 x86 
Device GUID = 
Device description = Primary Sound Driver 
Driver name = 

Device GUID = {4a1bd997-3986-4b7a-af02-7143e86af46c} 
Device description = Speakers/Headphones (SigmaTel High Definition Audio CODEC) 
Driver name = {0.0.0.00000000}.{4a1bd997-3986-4b7a-af02-7143e86af46c} 

Windows 7 x64 
Device GUID = 
Device description = Primary Sound Driver 
Driver name = 

Device GUID = {aaee894b-7a80-44ff-805c-8d5e12207136} 
Device description = Speakers/Headphones (SigmaTel High Definition Audio CODEC (for 64-bit Windows)) 
Driver name = {0.0.0.00000000}.{aaee894b-7a80-44ff-805c-8d5e12207136} 

三个机器上面列出的有戴尔Precision 390

程序相同配置驱动程序名称不同的结果从DX9SDK_DEC2005链接到“DSound.lib”。

有谁知道为什么Windows 7将驱动程序名称作为GUID而不是驱动程序名称返回?

+0

我想你是指**模块名称**。你需要什么?要识别设备,最好使用GUID。 – 2011-03-24 13:37:55

+0

是的,我的意思是模块名称(都看作参数名称)。该程序使用模块名称和设备描述将扬声器设备与麦克风设备(耳机)相匹配。我重新编译了代码,并删除了模块名称的匹配(只匹配设备描述),然后工作。但是,问题依然存在。 – Oskar 2011-03-24 17:31:02

+0

我会回答你的问题为“它只是”,虽然这可能不是一个令人满意的答案。毕竟,DirectX正在停止,至少对于.NET而言。 – 2011-03-25 07:50:03

回答

1

您看到的“驱动程序名称”是与DSound设备关联的音频端点的端点ID。一般而言,您不应该将此字符串呈现给客户,而应使用设备描述。

+0

我在MSDN中发现了这个。就像你说的那样。 (http://msdn.microsoft.com/en-us/library/dd370837(VS.85).aspx) “在DirectSound设备枚举过程中,DirectSound为每个枚举的设备提供端点ID字符串“。 – Oskar 2011-03-25 08:21:03

相关问题