开发者

How can i detect that something is plugged in to the audio jack on linux with python?

开发者 https://www.devze.com 2023-02-17 20:10 出处:网络
I am using the python tornado webserver with tornado.io. I want to prove that i can send events asynchronously via tornado.io.

I am using the python tornado webserver with tornado.io.

I want to prove that i can send events asynchronously via tornado.io.

How can i simply detect that somethi开发者_运维百科ng is plugged in the audio jack and send a message in tornado.io?


The idea is to find what is your sound card, then google for 'jack sensing for your audio_card_number" after that it is simple

import os
os.system("your_comand")

To get you started, here is a python script which does for the ac97 card. Your solution should be similar.

0

精彩评论

暂无评论...
验证码 换一张
取 消