Continuity
Continuity is a one-station radio for a folder of your own WAV files: a single Go program, standard library only, that plays the files on a fixed daily schedule taken from the real clock, so everyone who tunes in hears the same place in the same piece, and that names each programme only after it has ended. Run it from this folder with go run . -dir wavs (Go 1.21 or newer), or with a binary from dist/, and open the address it prints. The real input is your own folder of 16-bit, 44100 Hz, stereo WAV files, the machine's clock and zone, and whoever on the network opens the page. No audio is bundled, nothing is uploaded and nothing leaves the machine.
Running
go run . -dir wavs
go build -o continuity . && TZ=Europe/Berlin ./continuity -dir wavs -addr 127.0.0.1:8080
Flags: -dir (default .) and -addr (default :8080, every interface, so anyone on the network can listen; 127.0.0.1:8080 keeps it private). The day follows the machine's zone; set TZ to choose one. Two machines with the same file names, file lengths and zone broadcast the same programme at the same minute without talking to each other. The page is /, the record is /listings, the stream is /stream.wav (any player that takes a WAV stream, such as VLC or mpv; Safari is untested). Your ear is behind the clock by the player's own buffer.
A binary needs no Go to run: take continuity-darwin-arm64 on an Apple silicon Mac, continuity-linux-amd64 or continuity-linux-arm64 on Linux, continuity-windows-amd64.exe on Windows. They are about 10 MB each, so this folder does not carry them; one machine with Go builds all four into dist/ with:
for t in linux/amd64 linux/arm64 darwin/arm64 windows/amd64; do
GOOS=${t%/*} GOARCH=${t#*/} CGO_ENABLED=0 go build -o "dist/continuity-${t%/*}-${t#*/}$([ "${t%/*}" = windows ] && echo .exe)" .
done
The rules
Format: only WAV with 16-bit PCM, 44100 Hz, 2 channels is played. Any other file in the folder is refused at start-up with an exact reason (not a WAV file, N channels, want 2, N Hz, want 44100, N bits, want 16, and so on), printed and written into the day's log.
Order: for each pass k = 0, 1, 2 and so on, the files are sorted ascending by the SHA-256 of the bytes continuity:DATE:k, one NUL byte and the file name, where DATE is the day as YYYY-MM-DD. Passes follow each other from local midnight with no gap; the last programme is cut at the day's end. A day is frozen the first time it is needed, in <dir>/.continuity/YYYY-MM-DD.tsv, and never rewritten, so a file added today plays from a later midnight:
# continuity 2
# day 2026-10-13
# zone UTC
# frames 3810240000
# rule sha256("continuity:DAY:PASS" NUL name) ascending
# refused talk.mp3<TAB>not a WAV file
<startFrame><TAB><frames><TAB><fileFrames><TAB><fileSize><TAB><dataOffset><TAB><name><TAB><software>
A frame is 1/44100 s. A file that is missing or changed when its slot begins is withdrawn: the slot plays silence and <startFrame><TAB>missing (or size) is appended to YYYY-MM-DD.withdrawn.
Converting
The station plays only 16-bit, 44100 Hz, stereo WAV and never needs ffmpeg itself. To convert your own files, install ffmpeg once: brew install ffmpeg (macOS), sudo apt install ffmpeg (Debian, Ubuntu), winget install ffmpeg (Windows). Then paste the loop or loops the station prints under "Convert once, in this folder:" (Windows needs Git Bash or WSL).
Checks
go test ./... covers the chunk walk, the refusals, the order, the frozen day, midnight and both DST days, withdrawals, the stream and the withheld titles. qa/e2e.sh 1 2 3 4 5 6 7 10 11 runs the card's acceptance checks on real files made by testdata/make.sh (sox and ffmpeg, test fixtures only); qa/visual.py, qa/playback.py and qa/longlisten.py drive headless Chromium with Playwright. Results are in BUILD.md.
Colophon
Continuity, catalogue number 41. One station, no presenter, no forecast. The schedule is computed, the titles are given afterwards, and the record is kept in .continuity/, one file a day, uncorrected.
Files
- README.md
- go.mod
- main.go
- out/console-2-copy.txt
- out/console-2.txt
- out/console-3.txt
- out/console-4.txt
- out/console-5.txt
- out/console-5b.txt
- out/console-6.txt
- out/console-6b.txt
- out/e2e.txt
- out/h.txt
- out/listings.pdf
- out/longlisten-console.txt
- out/longlisten.txt
- out/playback-2.txt
- out/playback-console.txt
- out/playback.txt
- out/visual-console.txt
- out/visual.txt
- pages.go
- pages_test.go
- schedule.go
- schedule_test.go
- stream.go
- stream_test.go
- testdata/make.sh
- wav.go
- wav_test.go
- web/index.html
- web/listings.html
- web/style.css
- web/tokens.css
- web/tune.js
- web/wordmark.svg