2011-03-24 55 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

相關問題