brew install ffmpeg blackhole-2ch Set up BlackHole to capture system audio:
nano ./start-stream.sh #!/bin/bash
# ============================================================================
# STBY Radio Streaming Configuration
# ============================================================================
# Edit these two values, then run: ~/start-stream.sh
# Get this from Andrew Murray
PASSWORD="PASSWORD_HERE"
# What should appear on the departure board while you're streaming?
STREAM_TITLE="DJ Andrew Live From 30k Feet"
# ============================================================================
echo "🔍 Checking STBY Radio availability..."
echo ""
# Check if someone is already broadcasting from a DJ
STATUS=$(curl -s https://radio.stby.dev/status-json.xsl 2>/dev/null)
if echo "$STATUS" | grep -q '"server_name":"STBYradio"'; then
# Extract current broadcaster info
CURRENT_TITLE=$(echo "$STATUS" | grep -o '"title":"[^"]*"' | cut -d'"' -f4)
LISTENERS=$(echo "$STATUS" | grep -o '"listeners":[0-9]*' | grep -o '[0-9]*')
# Check if it's a live DJ or fallback stream
if echo "$CURRENT_TITLE" | grep -qE "(DJ|Live|Stream)" && [ "$CURRENT_TITLE" != "Ready for Broadcast" ]; then
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "❌ RUNWAY OCCUPIED"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo " Currently broadcasting: $CURRENT_TITLE"
echo " Listeners: $LISTENERS passengers"
echo ""
echo "💡 Someone else is live right now."
echo " Wait for them to finish, or coordinate to take over."
echo ""
exit 1
fi
fi
echo "✅ RUNWAY CLEAR - Starting broadcast..."
echo ""
echo "✈️ STBY Radio - Starting Broadcast"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Broadcasting as: $STREAM_TITLE"
echo ""
echo "Press Ctrl+C to stop broadcasting"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Start streaming
ffmpeg -f avfoundation -i ":BlackHole 2ch" -acodec libmp3lame -ab 128k -ar 44100 -ac 2 -content_type audio/mpeg -metadata title="$STREAM_TITLE" -f mp3 icecast://source:${PASSWORD}@radio.stby.dev:8001/radio
FFMPEG_EXIT=$?
echo ""
if [ $FFMPEG_EXIT -ne 0 ]; then
echo "❌ Connection failed!"
echo ""
echo "Possible issues:"
echo " • Wrong password"
echo " • Someone just connected before you"
echo " • Server is down"
echo ""
echo "Check status: curl https://radio.stby.dev/status-json.xsl"
else
echo "✈️ Stream stopped. See you next flight!"
fi chmod +x ./start-stream.sh ./start-stream.sh