Skip to content

Instantly share code, notes, and snippets.

@vladimirvs
vladimirvs / VolumeControlLinux.py
Created June 30, 2021 13:30
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)