是否检测到从音频端口移除了耳机设备? [英] Detect removal of headset device from audio port?

查看:120
本文介绍了是否检测到从音频端口移除了耳机设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我想知道如何检测耳机设备的卸下.拔下耳机设备后,我要停止当前正在运行的视频.有人知道怎么做吗?
我正在VB.net中编程,但是欢迎使用任何有关实现此目标的示例.

感谢您的关注!

Hi everybody!

I would like to know how to detect the removal of a headset device. When the headset device is unplugged I want to stop the currently running video. Does anybody know how to do that?
I''m programming in VB.net, but any examples on how to achieve this are welcome.

Thanks for your interest!

推荐答案

AFAIK,您不能没有一些专门的硬件来监视物理端口.
AFAIK, you can''t, not without some specialized hardware to monitor the physical port.


特定于驱动程序的监视,如果完全支持的话.并非所有的声卡都支持报告插孔状态.

也没有标准接口可以检查或获取通知.您必须编写特定于音频驱动程序的代码才能获取任何类型的通知,并且仅当音频驱动程序公开了这样做的接口时.
Monitoring that is driver specific, if it''s supported at all. Not all audio cards support reporting jack status.

There is also no standard interface to check for that or get notifications for it. You''d have to write code specific to the audio driver to get any kind of notification and that''s only if the audio driver exposes an interface to do so.


这篇关于是否检测到从音频端口移除了耳机设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆