denis-stepanov/advent

Support for volume lowering

Closed this issue · 2 comments

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.

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.

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.