Replace realtime Scribe streaming with post-recording batch transcription#14
Open
tadaspetra wants to merge 1 commit into
Open
Replace realtime Scribe streaming with post-recording batch transcription#14tadaspetra wants to merge 1 commit into
tadaspetra wants to merge 1 commit into
Conversation
…tion The realtime WebSocket session died during long silences (idle/session limits), killing the transcript for the rest of the take. Transcription is now a batch pass over the finalized recording, ordered so footage durability never depends on the network: - Stop flow saves the recovery checkpoint before any transcription call; failure or timeout falls back to full-duration sections with a visible warning instead of blocking or losing the take. - New main-process transcription-service extracts audio from the finalized file via ffmpeg stream copy and calls batch Scribe (scribe_v2, word timestamps); the API key never reaches the renderer. - Word timestamps map into recording time via per-file recorder start offsets instead of the old wall-clock estimate. - Record is blocked while the previous take is still post-processing so overlapping take flows cannot race on the shared recovery checkpoint. - Removed the WebSocket/AudioWorklet/PCM pipeline, live segment editing UI, scribe token IPC, and scribe-status module (net -215 lines). Tests: segment builder + timeout helper (15), transcription service temp-file cleanup and failure paths (10), IPC handler validation (3); media-cleanup and register-handlers suites updated. pnpm run check passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Transcription is no longer a realtime WebSocket session during recording — it is now a batch pass over the finalized recording file, run after Stop.
transcription-service: extracts audio from the finalized take via ffmpeg stream copy (source file untouched; remux also fixes MediaRecorder's incomplete WebM headers), uploads to ElevenLabs batch Scribe (scribe_v2, word-level timestamps). The API key stays in the main process — the renderer no longer receives a Scribe token.batch-transcriptrenderer helper: groups word timestamps into speech segments using the same 1.5s silence threshold the old VAD used, so auto-cut boundaries stay familiar..pending-recording.json) are on disk before any network call. Transcription failure or timeout falls back to full-duration sections with a visible warning — it can only ever cost the auto-cut, never footage.audioStartOffsetMs/cameraStartOffsetMs) instead of the old wall-clockscribeAudioOffsetestimate.audio-processor.ts,scribe-status.ts, live segment-editing keyboard shortcuts, scribe token IPC (net −215 lines).Why
The realtime Scribe session was killed server-side during long pauses (idle/session limits), silently ending transcription for the rest of the take. Batch transcription of the whole file removes that failure mode entirely, improves accuracy, and deletes the reconnect/offset-estimation complexity.
Behavior tradeoffs a reviewer should know
Tests
tests/unit/batch-transcript.test.ts— segment grouping, offsets, annotation stripping, timeout bounds (15 tests)tests/unit/transcription-service.test.ts— ffmpeg args, temp-file cleanup on success and every failure path, missing key/file/empty-file errors, response normalization (10 tests)tests/unit/register-handlers.test.ts— newtranscription:transcribehandler delegation + payload validation (3 tests)pnpm run checkpasses (lint, typecheck, unit/integration, Electron smoke, packaging smoke). Docs updated: feature-inventory, runbook, target-architecture,.env.example, AGENTS.md learned facts.Residual risk: real-network transcription path is exercised only manually; suggested spot-check is a short take with a deliberate 30s pause to confirm auto-cut boundaries.
🤖 Generated with Claude Code