A set of lightweight scripts to stream audio between two *nix machines. Perfect for use with a Raspberry Pi
Stream audio via UNIX pipes
This simple set of scripts allows streaming audio between two Linux machines, for example, a laptop and a Raspberry Pi. No audio backends such as Pulseaudio or JACK are required, the list of dependencies is very small.
SSH into your server, and download the scripts via git:
git clone https://github.com/connor-brooks/play_stdin.sh.git
If you're using a Raspberry Pi:
sudo apt-get install ffplay nmap
With the text editor of you choice, edit line 2 of play_stdin_server.sh
and change the CONTROLLER_PORT
variable to whatever port you want, for example run:
nano play_stdin_server.sh
Change the port number, and save.
To start the server, run the following command:
./play_stdin_server.sh &
You can now disconnect from the Raspberry Pi, but before you do, make sure to take note of your servers IP address, buy running the following:
sudo ifconfig
Generally your ip address will be in the format of 192.168.xxx.xxx
git clone https://github.com/connor-brooks/play_stdin.sh.git
Using the text editor of your choice, edit line 2 and 3 of play_stdin.sh
to match the port and IP of your server.
cat music.mp3 | ./play_stdin.sh &
Where music.mp3
is the song you'd like to play.
To pause from your client:
./play_stdin.sh TOGGLE
Or to stop the stream:
./play_stdin.sh STOP