Skip to content

Instantly share code, notes, and snippets.

@vladimirvs
Created June 30, 2021 13:30
Show Gist options
  • Save vladimirvs/5209c6dac58bc93891f5c990f926d7de to your computer and use it in GitHub Desktop.
Save vladimirvs/5209c6dac58bc93891f5c990f926d7de to your computer and use it in GitHub Desktop.
Volume Control Linux.py
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