This script will monitor the linux sound card file and fire an endpoint whenever the system starts to output audio. After a few seconds without audio output the script will fire a different endpoint.
Use the -e flag to run a container with the following envs:
AUDIO_PATH
defaults to '/proc/asound/card0/pcm0p/sub0/status'ENDPOINT_ON
defaults to 'http://localhost:1880/amp/on'ENDPOINT_OFF
defaults to 'http://localhost:1880/amp/off'