Skip to content
DigitalVoiceNZPublic

About

transcribe ham radio digital voice transmissions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RecWatch

Monitors DMR (Digital Mobile Radio) WAV recordings, converts them to Opus/OGG, and transcribes them via Whisper (Groq or OVH) into PostgreSQL.

Requirements

Setup

bun install
cp env.sample .env   # configure paths, DB, and API keys
psql -f setup.sql    # creates dmrids and msgs tables

To populate the dmrids table from a RadioID CSV dump (user.csv):

cd scripts && ./update_dmrids.sh

Usage

bun index.ts                     # Start watcher daemon (inotify with polling fallback)
bun index.ts --all [--limit=N]   # Batch process existing WAV files in WATCH_PATH
bun index.ts --fill [--limit=N]  # Backfill missing OVH transcriptions from DB
bun index.ts --dryrun            # Test processing & STT without DB writes or file moves

How It Works

  1. Detection: Watches WATCH_PATH for {src}-{timestamp}-{dmr_id}.wav (e.g., B-1699123456789-1234567.wav, where src maps to ALBUMS like B for FreeDMR530 / O for ZL-TRBO).
  2. Filtering: Files <50ms or corrupted are discarded. Files <1000ms are treated as kerchunks (logged as silent = TRUE, STT skipped).
  3. Audio Pipeline: Converts to 8 kHz mono Opus at 32 kbps with FFmpeg (highpass=f=150,dynaudnorm=f=75:g=25:p=0.95,volume=0.8) and archives to AUDIO_BASE_DIR/YYYY/MM/DD/{src}-{ts}-{id}.ogg.
  4. Contextual Whisper Prompt: Injects transmitter callsign/name (cached from dmrids), talkgroup name, and up to 2 recent talkgroup callsigns to improve transcription accuracy.
  5. Storage: Appends STT text, response time, and confidence metrics to msgs.txts (JSONB) allowing mulitple transcriptions for each transmission.

Utility Scripts

Located in scripts/:

  • update_dmrids.sh — Upserts user.csv into dmrids.
  • silence_update.ts — Re-evaluates audio silence in msgs using FFmpeg silencedetect.
  • whisper_analysis.ts — Transcription quality diagnostics and benchmarking.
  • migrate_db.sql (root) — Adds unique constraint on msgs(src, ts, id) for existing databases.

About

transcribe ham radio digital voice transmissions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages