Reimus Klinsman
Reimus Klinsman

Reputation: 947

Get system volume (Sound level) in linux using Python

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

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

Upvotes: 0

Views: 4996

Answers (2)

Burhan Khalid
Burhan Khalid

Reputation: 174614

For ALSA, use pyalsaaudio

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

Upvotes: 2

Luke
Luke

Reputation: 11644

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/ )

Upvotes: 0

Related Questions