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.

1

1 Answer 1

5

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

1
  • What is $SINK?
    – Zheng Qu
    Commented Aug 1, 2020 at 11:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .