Page 1 of 1

Stream audio from VLC to a Raspberry Pi (sox)

Posted: 28 Jan 2022 14:15
by ygoe
Hello,

I'd like to use VLC to stream audio content (no video) to a Raspberry Pi that has attached speakers. The intermediate goal is to listen to a YouTube live stream with these speakers and a Raspi. My final goal is to explore live audio distribution to multiple speakers from arbitrary sources (files, internet radio, YouTube live music). So directly receiving an internet stream or playing local files is not an option for the Raspi side. That final goal won't necessarily include VLC (maybe libVLC) or a Raspi but other sources and (selfmade) devices that send/receive an audio stream. But first I need some existing tools to play with and see how it works.

What I have now:
* I can watch and listen to a YouTube live stream with VLC on Windows. I used youtube-dl to extract the stream URL and open it in VLC.
* I can also use mpg123 to listen to internet radio directly on a Raspberry Pi. The command looks like 'mpg123 | sox | out123' because sox does the equalisation step.

I think I don't need mpg123 on the receiving end but can rather directly start the pipe with sox. But I'm not sure about that. I don't want to stream any audio codec data but the uncompressed wave data.

What I still need:
* How can I make VLC send out the currently playing audio (from whatever source) as uncompressed wave audio over the network?
* How can I receive an uncompressed wave stream on a Raspberry Pi so that it can be processed with sox and eventually passed to the speakers? Does sox do that itself or do I need another receiver in front of the pipe (maybe mpg123)?

I know that such a network stream would probably use UDP and just send the packets to a destination address. On the receiving end, there's a process that takes these packets and uses them, or not, the sender doesn't know or care. So VLC would need to send out such packets to the destination IP address and sox would need to receive them, in a compatible sample format. Sender and receiver might need to agree on a common audio sample format like "integer 16 bit 44.1 kHz stereo".