积极答复者
WM上如何获取当前产生声音的途径信息,比如,声音是从扬声筒,耳机,或者听筒

问题
答案
-
WOW! 你说的对,我忘了还有注册表了 ;-)
C++里面要自己注册notification, C#里面直接访问SystemState.HeadsetPresent和SystemState.SpeakerPhoneActive属性即可
I'm a device.- 已标记为答案 Jiong ShiMVP, Moderator 2011年3月10日 14:37
全部回复
-
No,做不到
I'm a device. -
// HeadsetPresent
// Gets a value indicating whether a headset is present
#define SN_HEADSETPRESENT_ROOT HKEY_LOCAL_MACHINE
#define SN_HEADSETPRESENT_PATH TEXT("System\\State\\Hardware")
#define SN_HEADSETPRESENT_VALUE TEXT("Headset")
// SpeakerPhoneActive
// Gets a value indicating whether the speakerphone is active
#define SN_SPEAKERPHONEACTIVE_ROOT HKEY_LOCAL_MACHINE
#define SN_SPEAKERPHONEACTIVE_PATH TEXT("System\\State\\Hardware")
#define SN_SPEAKERPHONEACTIVE_VALUE TEXT("Speaker")
可以通过这两个注册表项确定吧 -
WOW! 你说的对,我忘了还有注册表了 ;-)
C++里面要自己注册notification, C#里面直接访问SystemState.HeadsetPresent和SystemState.SpeakerPhoneActive属性即可
I'm a device.- 已标记为答案 Jiong ShiMVP, Moderator 2011年3月10日 14:37