当头戴耳机是否已插入检测 [英] Detecting when head phones are plugged in

查看:186
本文介绍了当头戴耳机是否已插入检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法来确定,编程将耳机插入计算机?

Is there any way to determine, programmatically when headphones are plugged into the computer?

从本质上讲,我只想写一个简单的工具,除非耳机插入,将静音我的声音。这甚至可能吗?

Essentially, I just want to write a simple tool that will mute my sound unless headphones are plugged in. Is this even possible?

推荐答案

在Windows Vista和超越,您可以使用该设备到货和移除通知,并获取端点尺寸规格,以确定您的音频解决方案的制造商认为特定端点一个耳机。

In Windows Vista and beyond, you can use the device arrival and removal notifications and retrieve the endpoint formfactor to determine if the manufacturer of your audio solution considers a particular endpoint a "headphone".

Vista之前没有确定该信息的方式。

Before Vista there was no way of determining this information.

这篇关于当头戴耳机是否已插入检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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