Created
June 30, 2021 13:30
-
-
Save vladimirvs/5209c6dac58bc93891f5c990f926d7de to your computer and use it in GitHub Desktop.
Volume Control Linux.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pulsectl import Pulse, PulseVolumeInfo | |
def setVolume(vol): | |
with Pulse('volume-example') as pulse: | |
print(vol) | |
for sink in pulse.sink_list(): | |
# Volume is usually in 0-1.0 range, with >1.0 being soft-boosted | |
pulse.volume_set_all_chans(sink, vol) | |
#Then call setVolume with value between: 0.0 - 1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment