Skip to content

Instantly share code, notes, and snippets.

@brettcvz
Last active December 31, 2015 23:49
Show Gist options
  • Save brettcvz/8062555 to your computer and use it in GitHub Desktop.
Save brettcvz/8062555 to your computer and use it in GitHub Desktop.
Audio streaming teleportation
#!/bin/bash
command -v play >/dev/null 2>&1 || { echo >&2 "I require 'play' but it's not installed. Install it using 'brew install sox' or 'sudo apt-get install sox'. Aborting."; exit 1;}
nc hopscotch.inkmobility.com 1339 > /dev/null &
PID_dump=$!
sleep 1
kill -9 $PID_dump
sleep 1
nc hopscotch.inkmobility.com 1339 | play --buffer 32 -t raw -r 44100 -s -L -b 16 -c 2 -
pacat -r -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | ncat -k --send-only -l -p 1337 > server_output.txt &
ssh -R 1339:localhost:1337 hopscotch.inkmobility.com &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment