Skip to content

use with airplay

Graham edited this page Nov 7, 2017 · 4 revisions

The sole purpose of this code so far is to plug into my shairport device to turn the hifi on and off in response to the audio signal being received.

Setup

$ ln -s ./stub.py on
$ ln -s ./stub.py off
$ shairport-sync -a wifihifi -B $(pwd)/on -E $(pwd)/off

Given the current implementation of shairport-sync's B and E flags this (a) means a small initial part of the audio is chopped off and (b) without intervention turns off every time the audio stops (even between tracks if the delay is too great - Amazon Music on iOS lock screen, I'm looking at you...). A simple resettable timer in the shell suffices for now, but I'm assuming the long-term best solution is to run a PCLK daemon which would start a timer for such shutdown requests.

Samples are now provided in the airplay-scripts subdirectory.

Bonus: Viera TV sync

My TV speakers aren't the best so it's nice to be able to supplement the audio with the hifi. Apparently TVs got smart while I wasn't looking and I can query the volume of my Panasonic TV. So the quick loop (some curl SOAP calls, some volume calls, some bash sleeps) will be in the viera-scripts subdirectory.

Clone this wiki locally