IR audio feedback (share output device)

I would like audio feedback when toggling MPD options using an IR remote. When toggling a feature on/off, you would hear the current feature state .

Example:

When turning on shuffle:

  1. Pause playback
  2. Play a local audio file that says “Shuffle On”
  3. Resume playback

This can be done with lircrc, but MPD hogs the audio output so the local sound file won’t play.

.lircrc - Shuffle

begin
prog = irexec
button = SHUFFLE
config = mpc pause; mpc repeat; aplay shuffle_on.wav; mpc play #<— aplay won’t work (device busy)
end

Of course the aplay command would be replaced by a script that reads the current MPD repeat setting and would play Shuffle_On.wav or Shuffle_Off.wav as needed.