Skip to content

Instantly share code, notes, and snippets.

@jj1bdx
Last active November 23, 2022 20:05
Show Gist options
  • Save jj1bdx/21b8bf2a6371a529a2188f49294ad0bf to your computer and use it in GitHub Desktop.
Save jj1bdx/21b8bf2a6371a529a2188f49294ad0bf to your computer and use it in GitHub Desktop.
Audio streaming script from Linux to macOS
# Sender Linux script
# Raw output from gqrx
# Note: the "hw:" in the device name
# Use "plughw:" if you need a conversion between the software and arecord
arecord --buffer-time=15000 -D hw:Loopback,1,0 -t raw -r 48000 -f FLOAT_LE -c 2 | nc "receiver macOS IP address" 23456
# Receiver macOS script
nc -l 23456 | play --buffer 64 -t raw -e floating-point -b32 -r 48000 -c 2 -q -
# Sender Linux script
# For 11025Hz mono stream
arecord --buffer-time=10000 -D plughw:CARD=CODEC,DEV=0 -t raw -r 11025 -f S16_LE | nc "receiver macOS IP address" 23456
# Receiver macOS script
nc -l 23456 | play --buffer 64 -t raw -e signed-integer -b16 -r 11025 -c 1 -q -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment