Skip to content

Instantly share code, notes, and snippets.

@varesa
Last active April 15, 2026 16:37
Show Gist options
  • Select an option

  • Save varesa/13e72e4e9f70d89e9062c861740d64fd to your computer and use it in GitHub Desktop.

Select an option

Save varesa/13e72e4e9f70d89e9062c861740d64fd to your computer and use it in GitHub Desktop.
#!/bin/bash
BROADCAST_ID="$(pw-dump | jq '.[]|select(.info.props["node.name"] == "broadcast")|.id')"
pw-record --target="$BROADCAST_ID" --rate=44100 -
broadcast = input.external.rawaudio(
id="broadcast",
restart=true,
restart_on_error=true,
buffer=0.2,
max=5.0,
"/usr/local/bin/cat-broadcast.sh"
)
output.icecast(
%flac,
host="localhost",
port=8000,
password="",
mount="ng.flac",
mksafe(broadcast) # mksafe() adds a implicit fallback to blank() to fallible sources
)
output.icecast(
%opus,
host="localhost",
port=8000,
password="",
mount="ng.opus",
mksafe(broadcast)
)
output.icecast(
%vorbis,
host="localhost",
port=8000,
password="",
mount="ng.ogg",
mksafe(broadcast)
)
output.icecast(
%mp3,
host="localhost",
port=8000,
password="",
mount="ng.mp3",
mksafe(broadcast)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment