feat: file transcription core (ffmpeg convert, whisper segments, srt/vtt export)#32
Merged
Merged
Conversation
…srt/vtt export, history migration)
Member
Author
|
@codex review |
6 tasks
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Refs #30 — PR 1 of 2 (core library slice; PR 2 adds the Tauri commands + UI).
What changed
src/engine/media.rs(new): ffmpeg resolution with actionable error, cancellable conversion of any audio/video file to 16 kHz mono s16 WAV (partial output + logs removed on cancel/failure), WAV duration reader for history.src/engine/transcript.rs(new):FileSegment, whisper--output-jsonparsing (drops non-speech markers), TXT/SRT/VTT formatters — pure and unit-tested, so exports can be regenerated from History at any time.src/engine/stt.rs:transcribe_file_with_cancel— whisper-cli with--output-json --print-progress --no-prints, progress callback parsed from the stderr log tail (UTF-8-lossy), same cancel/cleanup discipline as the existing dictation path (untouched).src/history.rs: additive migration adding nullablesource_file+segments_json(guardedALTER TABLEfor legacy DBs, columns inCREATE TABLEfor fresh ones); insert/list updated.src-tauri/src/engine.rs: dictation insert passesNonefor the two new fields — no behavior change.Tested
cargo test --workspace --locked --all-targets: 74 passed (baseline 67; new tests cover JSON parsing, SRT/VTT exact output incl. >1 h rollover, WAV duration, progress-line parsing, legacy-DB migration + fresh-DB round-trips).whisper-cli: output filename convention (<prefix>.jsonappending),progress = N%stderr format, and that--no-printskeeps progress lines.Not tested yet
No user-facing change; release notes drafted under Internal in
docs/releases/UNRELEASED.md.