RadioArchiver: The Pure-Python Broadcast Black Box
How a minimalist script uses wall-clock alignment and zero external dependencies to solve a 90-day legal compliance problem for radio stations.
- RadioArchiver satisfies strict 90-day broadcast retention laws using a zero-dependency Python stack to ensure rack-room stability.
- By aligning file splits exactly to the system clock's minute mark, the OS file system becomes an inherently searchable database.
- The system employs a dual architecture with a local Tkinter GUI for hardware engineers and a Flask web app for remote studio producers.
- Relying on raw PCM WAV files consumes massive storage but entirely eliminates framing errors and codec crashes.
Terrestrial broadcasters face a relentless physical reality. In jurisdictions like Japan, strict broadcast laws mandate the retention of all transmissions for exactly 90 days. This is not a theoretical exercise in data storage. It means writing up to 2.1 Terabytes of 24-bit, 48kHz audio reliably to a RAID1 array. You cannot drop a single second of audio.
Banning the Industry Standard
To solve this problem, most developers would immediately reach for FFmpeg. It is the undisputed king of media processing. The developer of RadioArchiver made a conscious decision to ban it entirely.
IT policies on air-gapped broadcast workstations often prohibit installing complex, compiled media codecs. By relying on a pure-Python stack using the sounddevice, numpy, and wave modules, the tool ensures absolute portability. It trades storage efficiency for bulletproof execution. Raw PCM WAV files eat disk space, but they never suffer from codec crashes or framing errors.
The Wall-Clock Database
The project's most clever architectural decision lies in how it chunks audio. Standard recording software splits files based on arbitrary durations, like every 60 seconds. RadioArchiver splits files based on the system clock's exact minute mark.
If the application starts recording at 12:00:30, the very first file will be exactly 30 seconds long. Subsequent files will start precisely at 12:01:00, 12:02:00, and so on. This transforms the standard operating file system into a highly queryable time-series database. Finding a specific broadcast segment requires zero database lookups. The filename itself is the index.
The Rack Room vs. The Studio
Software design often ignores the physical environment of the user. RadioArchiver acknowledges that a broadcast station has two distinct zones. The system runs a local Tkinter GUI designed for the broadcast engineer standing at a server rack. Simultaneously, it spins up a Flask server on the local network.
This dual interface means producers sitting in soundproof booths can pull exact audio clips from their iPads without ever touching the mission-critical recording PC.
Signal vs. Noise
The open-source radio ecosystem is filled with highly specialized tools. Many focus on real-time transcription or trunked radio monitoring. RadioArchiver is strictly a compliance logger.
The idea is to take live scanner audio, such as authenticated streams from Broadcastify, and continuously turn it into readable text with minimal babysitting.
While tools like RadioTranscriber focus on extracting meaning from audio, RadioArchiver focuses entirely on preserving the exact physical waveform for legal scrutiny. When compared to custom bash scripts or complex SDR setups, its value proposition is absolute simplicity.
| Project | Primary Use Case | Splitting Logic | External Dependencies |
|---|---|---|---|
| RadioArchiver | Legal Compliance Logging | Wall-Clock Minute Mark | Zero (Pure Python) |
| Trunk Recorder | Public Safety Scanning | Call-Based | C++, SDR Libraries |
| Custom Cron Scripts | General Archiving | Arbitrary Duration | FFmpeg, Bash |