I have a snapcast audio server, which is configured to have three audio streams (fifos): music, broadcast, and output. My speakers play the audio from the output stream, and my music players pipe input into the music stream. I can successfully pipe the music into the output so that I hear the music on the speakers with the command: cat /tmp/music > /tmp/output

Now I want to implement an "override" feature where input from the broadcast stream causes the output to instead play the (alert) from the broadcast, temporarily ignoring the stream from music until the broadcast ends. However, most of the time /tmp/broadcast is empty and has no input. Even a simple attempt to peek at the contents via dd bs=1 count=1 if=/tmp/broadcast hangs the terminal until there's data available in the broadcast. Therefore my attempts to do things like merge streams is unsuccessful.

I have looked into ffmpeg and pulseaudio, but cannot figure out if such a "selective override" is possible. Ffmpeg further appears to have bugs with multi-fifo input. The ideal solution would also "sound nice," i.e., perhaps do a 1/4 second fade between the streams as the broadcast takes over.

edit Running Ubuntu Desktop 18.04. Whoops!

  • To start with, which version of Linux have you installed (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, et al.) , and which release number? Different releases have different tools for us to recommend. Please click edit and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our channel to you. All facts about your system should go in the Question with edit
    – K7AAY
    Apr 10 '20 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.