Skip to content

Instantly share code, notes, and snippets.

@varesa
Created April 14, 2023 21:02
Show Gist options
  • Save varesa/a28d2f6ab7e4570bbbb1c6a924c1993d to your computer and use it in GitHub Desktop.
Save varesa/a28d2f6ab7e4570bbbb1c6a924c1993d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
source venv/bin/activate
echo "Starting to save ROC"
gst-launch-1.0 alsasrc ! audio/x-raw,channels=2,rate=48000 ! audioconvert ! audioconvert ! queue min-threshold-bytes=96000 max-size-bytes=192000 ! opusenc bitrate=128000 inband-fec=true frame-size=20 ! oggmux max-delay=100 ! filesink location=roc.opus >/dev/null &
gstpid="$!"
sleep 30
echo "Starting to save icecast"
curl -Ss http://peppuli.idm.wappuradio.fi/wappuradio1.opus -o icecast.opus &
curlpid="$!"
sleep 30
echo "Killing streams"
kill "$gstpid"
kill "$curlpid"
echo "Comparing"
# https://github.com/bbc/audio-offset-finder
audio-offset-finder --find-offset-of icecast.opus --within roc.opus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment