简体   繁体   English

如何使用 python 代码在 ubuntu 中使右/左扬声器静音?

[英]How can I mute right/left speaker in ubuntu with python code?

I use os.system('amixer sset Master 0,-') to disable right speaker but when I change it to os.system('amixer sset Master -,0') it says that I'm using invalid option.我使用os.system('amixer sset Master 0,-')禁用右扬声器,但是当我将其更改为os.system('amixer sset Master -,0')它说我正在使用无效选项。 Does anybody know what is the problem?有谁知道是什么问题? and if this code doesn't work could you suggest any codes to disable left/right speaker??如果此代码不起作用,您能否建议任何禁用左/右扬声器的代码?

os.system("amixer -D pulse sset Master 50%,0%")
最后,上面的代码对我有用:) 更改主百分比以减少/增加每一侧的音量。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用树莓派 python 在左扬声器中播放音乐并在右扬声器中播放麦克风声音? - How to play music in left speaker and microphone voice in right speaker with raspberry pi python? Discord - 我可以通过 python 代码将语音通道中的其他人静音吗? - Discord - can I mute others in the voice channel from a python code? Python - 如何用左右空格填充字符串? - Python - How can I pad a string with spaces from the right and left? 如何使用记录器使python中的特定日志静音? - How can I mute particular logs in python using logger? 如何在Python中调用静音/扬声器控制键。 戴尔Latitude E7440 - How to call upon Mute/Speaker control keys in Python. Dell latitude E7440 如何左右旋转列表? - How can I rotate a list right and left? 如何在python中拆分列表以使用分隔符左侧而不是右侧的元素获取新列表 - How can I Split a list in python to get a new list with elements to the left of the delimiter instead of the right 为什么 Python 中的列表元素是从左到右索引的? 我怎样才能扭转这种局面? - Why are list elements in Python indexed from left to right? How can I reverse this? 如何修改它以从右到左读取并提取行? 而不是从左到右阅读 - How can I modify this to read from right to left and extract the lines? Instead of reading left to right 如何在VS Code和Ubuntu中使用Keras模块运行python代码? - How can I run a python code with Keras module in VS Code and Ubuntu?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM