S
S
T
T
B
B
Y
Y
R
R
A
A
D
D
I
I
O
O

STANDBY
Now Playing
Ready for Broadcast
Passengers
0
Pilot The Stream
Setup instructions to start broadcasting
Step 1: Install Dependencies
Open Terminal and run:
brew install ffmpeg blackhole-2ch
Step 2: Configure Audio Routing

Set up BlackHole to capture system audio:

  1. Open "Audio MIDI Setup" on your Mac
  2. Click the "+" button in the bottom-left corner
  3. Select "Create Multi-Output Device"
  4. Check both "BlackHole 2ch" and your speakers/headphones
  5. Right-click the device and select "Use This Device For Sound Output"
💡 This lets you hear audio while streaming it
Step 3: Create Streaming Script
Create the script file:
nano ./start-stream.sh
Copy this script into the file:
#!/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
Make it executable:
chmod +x ./start-stream.sh
Step 4: Start Streaming!
To become the DJ, run:
./start-stream.sh