【问题标题】:Is it possible to detect whether or not something is plugged into the audio jack, in python?是否可以在 python 中检测是否有东西插入音频插孔?
【发布时间】:2011-08-19 06:06:12
【问题描述】:

我正在尝试检测是否有设备使用 python 连接到音频插孔。这是在 Windows 7 中。

【问题讨论】:

    标签: python audio windows-7 headphones


    【解决方案1】:

    https://superuser.com/questions/110933/how-does-a-sound-card-determine-if-headphones-are-plugged-in

    答案是:这取决于您的硬件。在过去的十年里,我没有看到任何操作系统检测到耳机,但一些便宜的声卡确实支持它。 (编辑:根据拉里奥斯特曼的评论,它们现在是标准的。)

    如果你的声卡支持的话,我相信你会找到下面的答案:Detecting when head phones are plugged in(python 可能需要询问一些系统 API)

    【讨论】:

    • Windows Vista 及更高版本已完成此操作。每个销售带有 Windows Vista 或更高版本徽标的音频解决方案都需要支持插孔检测。所以我不完全确定我理解你为什么说“我在过去十年里没有看到任何操作系统检测到耳机”。在过去的五年里,杰克检测一直是 Windows 的一部分。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-18
    相关资源
    最近更新 更多