7

Is it possible to set an upper limit for PulseAudio on startup? I would like to make sure that I do not put the volume too high for the sake of my eardrums.

I looked into pactl set-sink-volume but that doesn't allow me to set a maximum volume limit. As well I cannot find anything under man pactl.

3

You can do it by the following bash code

#!/bin/bash
x=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
if [[ $x -le 200 ]]
then
    pactl set-sink-volume 0 +5% 
fi

In this volume is stored in variable x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.