denis-stepanov / advent

Vent intrusive TV ads
GNU General Public License v3.0
14 stars 1 forks source link

Support for volume lowering #14

Closed denis-stepanov closed 2 years ago

denis-stepanov commented 2 years ago

It could be of interest when an ad kicks in not to mute it completely but to decrease volume by a certain amount. And, correspondingly, increase it back for content watching. The amount could be calculated if the volume is known, or some predefined configurable value.

denis-stepanov commented 2 years ago

PulseAudio:

$ pactl set-sink-volume @DEFAULT_SINK@ +10%
$ pactl set-sink-volume @DEFAULT_SINK@ -10%
$ pactl set-sink-volume @DEFAULT_SINK@ 20%
$ pactl get-sink-volume @DEFAULT_SINK@
Volume: front-left: 13107 /  20% / -41.94 dB,   front-right: 13107 /  20% / -41.94 dB
        balance 0.00
$

So querying is supported and various options are available.

Harmony:

$ curl -s -S -X POST http://localhost:8282/hubs/harmony/commands/volume-down
$ curl -s -S -X POST http://localhost:8282/hubs/harmony/commands/volume-up

This will change volume by 1 (equivalent of pressing a volume button on a TV remote). Not clear at this point if multiple actions need spacing or not.

denis-stepanov commented 2 years ago

This will change volume by 1 (equivalent of pressing a volume button on a TV remote). Not clear at this point if multiple actions need spacing or not.

Yes, need spacing of 0.25 s at least, otherwise works unreliably.