Skip to content

Instantly share code, notes, and snippets.

@brianfay
Last active January 10, 2017 08:00
Show Gist options
  • Save brianfay/3369f87c042e5ed4c110d1f565cf3fdd to your computer and use it in GitHub Desktop.
Save brianfay/3369f87c042e5ed4c110d1f565cf3fdd to your computer and use it in GitHub Desktop.
Streaming vinyl over wifi from raspberry pi to laptop
#! /bin/bash
#shove this in /usr/local/bin/ on the Pi and give it execute permissions
#could probably improve very easily by checking if port 5555 is listening before trying to toss data at it
#stole ideas from here: https://hydrogenaud.io/index.php/topic,102996.0.html
{
while true;
do sox -talsa hw:CODEC -r44100 -b16 --buffer 4096 -tflac - \
| pv | nc 192.168.1.4 5555;
sleep 10;
done;
} &> /dev/null
#put this in /etc/init/ on the Pi, need to install Upstart first
#dunno if putting it on all of these runlevels is a good idea, probably just need [1]
start on runlevel [12345]
stop on shutdown
exec /usr/local/bin/serve-vinyl
#!/bin/bash
#Put this under a bin directory, I'm using ~/local/bin/
#When you wanna listen to your RPi vinyl, just type stream-vinyl in a terminal wooo you're done
nc -l -p 5555 | play -r44100 -b16 --buffer 4096 -tflac -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment