Commit Graph
3 Commits
Author SHA1 Message Date
felixmandClaude Opus 5 9d04427816 Trim only the real click, and surface mid-clip dropouts
Transcripts came back short, but the log showed the whole clip going up:
captured samples matched wall clock and upload duration matched the
recording minus exactly the fixed 150 ms head trim. So nothing was being
cut in transit — the losses had to be at the edges or inside the audio,
and neither was visible.

Trim the stream-open click by measurement instead of by the clock: cut
only the leading frames that are genuinely louder than the rest of the
clip, up to the old cap. Mics that do not click now keep their first
syllable.

Measure each frame against its own mean so a steady DC bias — or a
stream frozen on one value — reads as the silence it is, and report the
longest run of digital silence as dead=. A live mic never goes below
DEAD_AIR_DBFS, so anything there is input that never arrived, which is
what following the system default source invites. Warn on startup when
no device is pinned, log the noise floor next to the speech level, and
log how much of the clip the output limiter had to clamp.

BLURT_SAVE_CAPTURES keeps the raw and uploaded WAVs per clip, so the
next short transcript can be checked against what the API actually got.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 20:45:14 -04:00
felixmandClaude Opus 5 e3faf32f55 Fix Linux capture: negotiate rate, condition audio, pin the device
Transcripts were far worse on Linux than on Windows for the same model, because
of what reached the API rather than the model itself.

Picking any mic from the tray menu never worked: PortAudio exposes the friendly
names through PipeWire's JACK host API, which only accepts 48 kHz, so opening at
16 kHz failed outright and recording always fell back to the system default —
whichever source PipeWire happened to prefer at that moment. That source is
often the raw AMD digital mic, which ships a +0.14 FS DC bias, a full-scale
clipped click in the first 15 ms of every stream, and speech around -50 dBFS.
Windows' vendor driver hides all of this; PipeWire hands over the raw stream.

- Negotiate rate and channels per device, then downmix and resample with
  resample_poly, so every listed device can actually be recorded from.
- Hide devices that cannot work: playback endpoints JACK re-exposes as inputs,
  and raw ALSA hw: devices a sound server already owns (acp: hw:2,0 blocks
  forever on open).
- Persist the chosen device by name in device.txt; PortAudio indices shift as
  USB gear comes and goes. Add a "System default" menu entry.
- Condition every clip before upload: trim the warm-up click, high-pass out DC,
  normalise towards -20 dBFS under a -1 dBFS ceiling.
- Refuse near-silent clips instead of paying for a hallucination, and log
  capture levels (speech, rms, peak, DC, clipping) plus PortAudio status
  warnings, which previously went to a discarded stderr.
- Import scipy.signal as dsp: it was shadowing the stdlib signal module that
  the SIGUSR1 hotkey toggle depends on.

mic_check.py records from Blurt's configured input, reports levels before and
after conditioning, saves the WAV, and transcribes it with the current model.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 18:58:39 -04:00
felixmandClaude Opus 4.8 5864d78081 Add README and cross-platform export tool
README documents minimal setup, run, and config for Linux and Windows. export.py bundles just the source into a zip (no .venv, caches, or API key files) for moving to another machine; it's pure stdlib run via 'uv run export.py', so it behaves identically on Linux and Windows with no shell required.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 09:03:43 -04:00