feat(desktop): Whisper subtitle and caption generation in Studio Mode - #2413
adamscarmccoy-boop wants to merge 2 commits into
Conversation
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
| #[tauri::command] | ||
| pub async fn generate_studio_captions( |
There was a problem hiding this comment.
Caption command is unreachable. The new file is not declared as a Rust module, and
generate_studio_captions is not registered with Tauri’s command builder. The file is therefore not compiled into the desktop app, so the Studio UI cannot invoke this caption-generation command.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/studio_caption.rs
Line: 4-5
Comment:
**Caption command is unreachable.** The new file is not declared as a Rust module, and `generate_studio_captions` is not registered with Tauri’s command builder. The file is therefore not compiled into the desktop app, so the Studio UI cannot invoke this caption-generation command.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| let status = std::process::Command::new("whisper") | ||
| .arg("-m").arg("models/ggml-base.bin") |
There was a problem hiding this comment.
Whisper resources are unavailable. Once the command is wired up, a normal desktop installation cannot rely on a
whisper executable being on PATH or models/ggml-base.bin existing under its working directory. Neither is bundled, and the existing transcription flow stores downloaded models in app-local data. The command will fail to start or load its model.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/studio_caption.rs
Line: 15-16
Comment:
**Whisper resources are unavailable.** Once the command is wired up, a normal desktop installation cannot rely on a `whisper` executable being on PATH or `models/ggml-base.bin` existing under its working directory. Neither is bundled, and the existing transcription flow stores downloaded models in app-local data. The command will fail to start or load its model.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| // Execute local Whisper ONNX/Whisper-rs binding pass with tab indentation | ||
| let status = std::process::Command::new("whisper") | ||
| .arg("-m").arg("models/ggml-base.bin") | ||
| .arg("-f").arg(&audio_path) |
There was a problem hiding this comment.
Studio audio skips preparation. Once this command is wired to Studio recordings, it will pass M4A or Ogg audio directly to the CLI. The existing caption flow decodes and assembles Studio audio before transcription; this command skips that preparation and cannot rely on the input used by the working flow, so caption generation needs to prepare the recording first.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/studio_caption.rs
Line: 17
Comment:
**Studio audio skips preparation.** Once this command is wired to Studio recordings, it will pass M4A or Ogg audio directly to the CLI. The existing caption flow decodes and assembles Studio audio before transcription; this command skips that preparation and cannot rely on the input used by the working flow, so caption generation needs to prepare the recording first.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| return Err("Audio track file not found for caption processing".to_string()); | ||
| } | ||
|
|
||
| // Execute local Whisper ONNX/Whisper-rs binding pass with tab indentation |
There was a problem hiding this comment.
Comment misstates the implementation. This comment narrates the new command and describes an ONNX/Whisper-rs binding, but the code launches an external process. The repository requires comments to capture useful, non-obvious context rather than narrate code. Remove this misleading comment before merging.
| // Execute local Whisper ONNX/Whisper-rs binding pass with tab indentation |
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/studio_caption.rs
Line: 14
Comment:
**Comment misstates the implementation.** This comment narrates the new command and describes an ONNX/Whisper-rs binding, but the code launches an external process. The repository requires comments to capture useful, non-obvious context rather than narrate code. Remove this misleading comment before merging.
```suggestion
```
**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| audio_path: String, | ||
| output_srt_path: String, | ||
| ) -> Result<String, String> { |
There was a problem hiding this comment.
Rust indentation violates style. The new function uses tab indentation rather than the repository-required default rustfmt style. Format the file before merging to satisfy that requirement.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/studio_caption.rs
Line: 6-8
Comment:
**Rust indentation violates style.** The new function uses tab indentation rather than the repository-required default rustfmt style. Format the file before merging to satisfy that requirement.
**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
…stfmt styling (CapSoftware#361) Resolves CapSoftware#361. /claim CapSoftware#361 - Register generate_studio_captions command with tauri_specta builder in lib.rs - Resolve Whisper & Parakeet ONNX model paths dynamically from app local data directory - Wire studio recording preparation via canonical transcribe_audio pipeline - Apply standard rustfmt 4-space indentation and clean docstrings
Resolves #361. /claim #361
This PR is not ready to merge because the caption command is unreachable and its execution path would not work for a normal Studio recording.
Findings
Fix with agent prompt
Summary
This PR adds a standalone Tauri command intended to generate Studio captions by running a Whisper CLI.
Reviews (1) · Last reviewed commit: "feat(desktop): add whisper studio mode c..."