diff --git a/CLAUDE.md b/CLAUDE.md index e1b6473..57f5f87 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,8 +15,10 @@ python isr.py myconfig.ini # custom config file python isr.py --list-devices # list available ALSA devices # Run the web UI -python web.py # http://localhost:8080 -python web.py --dir recordings # custom recordings directory +python web.py # http://localhost:8080 +python web.py --dir recordings # custom recordings directory +python web.py --port 8888 # custom port +python web.py --threshold 0.03 # loudness threshold (0-1, default 0.05) # Stop: Ctrl+C (or docker compose down) @@ -53,6 +55,16 @@ docker compose down - OGG/Opus/FLAC headers captured from first ~16 KB of stream and prepended to each split file - File splits aligned to time period boundaries (`get_next_split_time()`) - SIGTERM handled in `main()` so Docker `docker compose down` shuts down cleanly +- `RecorderManager._write_status()` atomically writes `recordings/status.json` every 2 s while running; deleted on clean shutdown so the web UI shows no stale active-recording badges + +### Web UI (web.py) +- **`GET /`** — Single-page archive table; lists all recordings sorted newest first +- **`GET /api/files`** — JSON list of file metadata (name, size, date, duration, ext, recording flag) +- **`GET /api/analyze?file=`** — RMS loudness analysis for WAV and FLAC files; returns waveform data, loud sections, and duration. Requires `numpy` and `soundfile` for FLAC. +- **`GET /api/status`** — Returns `{"active": [...]}` from `status.json`; used by the UI to animate the REC badge on in-progress files (polled every 5 s) +- **`GET /stream/`** — Serves audio for inline `