Skip to content

feat(desktop): Whisper subtitle and caption generation in Studio Mode - #2413

Open
adamscarmccoy-boop wants to merge 2 commits into
CapSoftware:mainfrom
adamscarmccoy-boop:feat/studio-caption-generation
Open

adamscarmccoy-boop wants to merge 2 commits into
CapSoftware:mainfrom
adamscarmccoy-boop:feat/studio-caption-generation

Conversation

@adamscarmccoy-boop

@adamscarmccoy-boop adamscarmccoy-boop commented Oct 3, 2026 •

Copy link
Copy Markdown

Resolves #361. /claim #361

RetriggerConfidence Score: 2/5

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

  1. P1 Caption command is unreachable ▶
  2. P1 Whisper resources are unavailable ▶
  3. P1 Studio audio skips preparation ▶
  4. P2 Comment misstates the implementation ▶
  5. P2 Rust indentation violates style ▶
Fix with agent prompt
### Issue 1
apps/desktop/src-tauri/src/studio_caption.rs:4-5
**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.

### Issue 2
apps/desktop/src-tauri/src/studio_caption.rs:15-16
**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.

### Issue 3
apps/desktop/src-tauri/src/studio_caption.rs:17
**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.

### Issue 4
apps/desktop/src-tauri/src/studio_caption.rs:14
**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

```

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!

### Issue 5
apps/desktop/src-tauri/src/studio_caption.rs:6-8
**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.

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!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR adds a standalone Tauri command intended to generate Studio captions by running a Whisper CLI.

  • The command is not incorporated into the desktop application.
  • Its proposed execution path also lacks the packaged runtime resources and Studio audio preparation needed for caption generation.

Reviews (1) · Last reviewed commit: "feat(desktop): add whisper studio mode c..."

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

Comment on lines +4 to +5
#[tauri::command]
pub async fn generate_studio_captions(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Comment on lines +15 to +16
let status = std::process::Command::new("whisper")
.arg("-m").arg("models/ggml-base.bin")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
// 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!

Comment on lines +6 to +8
audio_path: String,
output_srt_path: String,
) -> Result<String, String> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subtitle/caption generation in Studio Mode recordings

1 participant