Skip to content

Audit follow-up: correctness fixes, JSON output, tests, CI, packaging - #4

Merged
buzz39 merged 1 commit into
mainfrom
copilot/audit-open-source-project
Apr 21, 2026
Merged

buzz39 merged 1 commit into
mainfrom
copilot/audit-open-source-project

Conversation

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Acting on the prior audit of this repo, this PR ships the highest-leverage subset: real correctness bugs in the audio pipeline, a missing machine-readable output format, and the trust-signal infrastructure (tests, CI, packaging, changelog) that the project was lacking.

Correctness fixes

  • WAV save produced static. audio_capture.save_wav wrote raw float32 frames through stdlib wave, which always emits a WAVE_FORMAT_PCM header — most players then decoded the bytes as int32. Now clipped + converted to int16 PCM.
  • 16 kHz resampling was nearest-neighbour decimation. Aliased badly at 48 kHz → 16 kHz and measurably hurts WER. Now uses scipy.signal.resample_poly (polyphase + anti-aliasing) when available, with a linear-interp fallback.
  • Transcriber was hard-coded to CPU. Now probes torch.cuda.is_available() and picks a CTranslate2-compatible compute type (float16 only on CUDA, int8 on CPU).
  • SIGINT handler leaked. start_recording now restores the previous handler on exit, so successive tray-mode recordings and the parent shell aren't affected.

New output format

  • --format json (and included in --format all). Versioned schema:
    {"version": 1, "segments": [{"start": 2.34, "end": 5.12, "speaker": "Speaker 1", "text": "..."}]}

Packaging & dev experience

  • pyproject.toml adds a meeting-recorder console script and optional dep groups (windows, pyannote, dev). Flat layout preserved via py-modules so existing imports keep working.
  • faster_whisper import made lazy in transcriber.py — importing CLI helpers (and tests) no longer requires the full ML stack.
  • Upper bounds on pyannote.audio<4 and torch<3 (both ship breaking releases routinely); same bounds mirrored across requirements*.txt.

Tests & CI

  • tests/ (22 tests) — format_* helpers, txt/srt/json writers, _get_output_paths for every --format, format inference from extension, energy diarizer (empty input, label format, reset, max-speaker cap, distinct-tone case). conftest.py puts the repo root on sys.path so the flat-layout modules import without an editable install.
  • .github/workflows/ci.yml — ruff lint + pytest matrix on Linux/macOS/Windows × Python 3.10/3.11/3.12. Heavy runtime deps not installed in CI; the lazy imports keep the test surface lightweight.
  • Ruff config in pyproject.toml with conservative rule set (E/F/W/I/UP).

Documentation

  • CHANGELOG.md (Keep-a-Changelog), CONTRIBUTING.md (setup, tests, lint).
  • README: CI + platform badges, "Why this vs. alternatives?" comparison table (whisper.cpp, Buzz, WhisperX, cloud), JSON output example, "Known limitations" section that's honest about per-chunk diarization drift and the energy heuristic's failure modes.

Intentionally deferred

Each of these warrants its own PR with real-device testing on multiple OSes:

  • Cross-platform audio capture (PulseAudio / CoreAudio / ScreenCaptureKit).
  • src/ package restructure.
  • Per-chunk → end-to-end diarization pipeline.
  • Local-LLM summarisation, calendar integration, voiceprint speaker naming.

@buzz39
buzz39 marked this pull request as ready for review April 21, 2026 13:12
@buzz39
buzz39 merged commit 3fadc2c into main Apr 21, 2026
11 checks passed
@buzz39
buzz39 deleted the copilot/audit-open-source-project branch April 21, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants