0

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

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

Reimus Klinsman
  • 898
  • 2
  • 12
  • 23
  • Likely depends on if the system is using alsa, pulseaudio, or OSS (not likely since alsa has OSS compatibility). Good luck. – jordanm Jul 19 '12 at 02:57
  • Kindly refer http://stackoverflow.com/questions/1936828/how-get-sound-input-from-microphone-in-python-and-process-it-on-the-fly – Learner Jul 19 '12 at 05:31

2 Answers2

2

For ALSA, use pyalsaaudio

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

Sam Mason
  • 15,216
  • 1
  • 41
  • 60
Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
0

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

Luke
  • 11,374
  • 2
  • 48
  • 61
  • To apply this answer in Python, you would just use a system call, e.g. popen or similar. – lxop Jul 19 '12 at 03:17