Request: play local stream from pipe
Hey, I'm trying to connect go-chromecast with mopidy, using it as an audio sink. The way other programs work are by playing media from a pipe (fifo) or via standard input. It seems that is not currently possible with go-chromecast. Of course, this mode has limited seek possibilities.
Hello! There is go-chromecast transcode --command="/usr/bin/command" which will run the command and pipe the output via a HTTP response to the Chromecast, would this work for your use-case?
I tried go-chromecast transcode --command="cat /tmp/fifo" and piped an mp3 into the fifo but that did not work.
unable to transcode media: command and content-type flags needs to be set when transcoding.
Sorry, it needs the --content-type flag set as well (since it is currently unable to determine the media type). Does setting a content type work?
Thanks for your hints, this seems to work
mkfifo /tmp/stream
cat test.mp3 > /tmp/stream
go-chromecast transcode --content-type audio/mp3 --command="cat /tmp/stream" -n speaker_id
So basically, do use go-chromecast I would have to write a helper application that would detect if a buffer is filled and what the content type would be and instruct go-chromecast to play from the buffer. I think it would probably be easier to write the input to a cache file with correct media type and let go-chromecast play that file than using the transcode workaround.
When I experimented with mopidy using a pipe as output and forked-daapd as chromecast broadcasting backend, I noted that it is able to detect media type and even volume change through the pipe. I wonder what kind of format was written to the pipe. It seems very usable when you want to integrate different audio components via streaming.