jtodd.fr
February 10th, 2018, 08:30 PM
I was playing with pyalsaaudio (v0.8.4) using python (v2.7.12 with GCC 5.4.0 20160609) on Ubuntu 16.04.3 LTS. My goal is to read the current sound volume level and then adjust the value by e.g. increment by 10% or 10. When testing the sample code
import alsaaudio
mixer = alsaaudio.Mixer()
vol = mixer.getvolume()
print(vol)
It prints [27, 27], but checking with alsamixer it shows master sound is 20 where View is F3:[Playback] and Item is Master [dB gain: -33.50].
How should I interpret such different? I completely don't understand Linux sound system, so I appreciate any suggestions.
Thanks.
import alsaaudio
mixer = alsaaudio.Mixer()
vol = mixer.getvolume()
print(vol)
It prints [27, 27], but checking with alsamixer it shows master sound is 20 where View is F3:[Playback] and Item is Master [dB gain: -33.50].
How should I interpret such different? I completely don't understand Linux sound system, so I appreciate any suggestions.
Thanks.