Skip to content

Fix/transcription perf#7

Merged
onyxhat merged 17 commits into
mainfrom
fix/transcription-perf
Mar 26, 2026
Merged

Fix/transcription perf#7
onyxhat merged 17 commits into
mainfrom
fix/transcription-perf

Conversation

@onyxhat

@onyxhat onyxhat commented Mar 26, 2026

Copy link
Copy Markdown
Owner
  • improve TUI and progress display
  • transcription performance improvements
  • decouple tagging dedupe logic from jinja templates

Isaac Springer and others added 17 commits March 25, 2026 08:02
Replace in-memory list[np.ndarray] buffers with temp raw .f32 files so
memory usage during recording is O(chunk) rather than O(recording length),
eliminating the 2-3x spike from np.concatenate on stop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rror

- Add threading.Lock (_fh_lock) to protect file handle access from the
  audio callback thread and stop() racing on close
- Move temp file creation to after the device check so no handles leak
  when no input device is found
- Call _cleanup_temp_files() when PortAudioError is raised in start()
- Add _cleanup_temp_files() helper that closes and deletes both raw temp files
- Add _write_loopback_frame() helper used by the macOS loopback callback
- Fix stop() finally block to delete and null out both mic and loopback
  temp paths, and read loopback bytes inside the try before cleanup runs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds scipy>=1.13 dependency and introduces _convert_to_16khz_array on
WhisperTranscriber using scipy.signal.resample, eliminating the redundant
np.arange index allocation in both transcriber._convert_to_16khz and
recorder loopback resampling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Eliminates 3 unnecessary disk write+read cycles per transcription by
refactoring _run_whisper and _run_whisper_segments to accept np.ndarray
directly, updating _diarize to work in-memory, computing duration from
array length, and removing the file-based _convert_to_16khz and
_calculate_duration methods along with the unused wave import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n CLI

Adds an optional on_progress(ratio: float) callback to WhisperTranscriber.transcribe()
and _run_whisper(), and wires it to a Rich live progress bar in main.py so users
see incremental feedback instead of silence during long transcriptions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Submit generate_title and generate_tags concurrently via ThreadPoolExecutor(max_workers=2) in _process_audio, eliminating 2-4s of sequential LLM latency. Adds a concurrency test to verify both calls start within 20ms of each other.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@onyxhat
onyxhat merged commit 8ae83f2 into main Mar 26, 2026
1 check passed
@onyxhat
onyxhat deleted the fix/transcription-perf branch March 26, 2026 17:04
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.

1 participant