是否自动获得有关音频设备连接/断开的通知? [英] Get automatically notified on audio device connection/disconnection?
本文介绍了是否自动获得有关音频设备连接/断开的通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当用户连接或断开音频设备时,是否可以自动获得通知?
Is it possible to get automatically notified whenever the user connects or disconnects an audio device?
推荐答案
In Vista+ you can use Core Audio IMMNotificationClient interface to be notified.
当发生以下情况时,IMMNotificationClient接口会提供通知: 音频端点设备被添加或删除时,状态为 端点设备的属性更改,或者当端点设备的属性更改时 分配给端点设备的默认角色.
The IMMNotificationClient interface provides notifications when an audio endpoint device is added or removed, when the state or properties of an endpoint device change, or when there is a change in the default role assigned to an endpoint device.
处理WM_DEVICECHANGE
和/或轮询是odler OS版本中的解决方案.
Handling WM_DEVICECHANGE
and/or polling is the solution in odler OS versions.
这篇关于是否自动获得有关音频设备连接/断开的通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文