Get system volume (Sound level) in linux using Python

我是研究僧i 提交于 2019-12-12 02:18:54

问题


I am using Fedora 16 and modifying a program in python 2.7.

How do I get the systems volume (Sound level)?


回答1:


For ALSA, use pyalsaaudio

For Pulse, its a bit raw. There are ctype bindings




回答2:


If you are using ALSA, you can run 'amixer' to dump the state of all volume controls. For PulseAudio, I believe 'pacmd dump' should get similar info. (see http://blog.waan.name/pulseaudio-setting-volume-from-command-line/ )



来源:https://stackoverflow.com/questions/11553131/get-system-volume-sound-level-in-linux-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!