Skip to content

Fix transcription sample-rate handling#740

Open
kcfancher wants to merge 1 commit intoOpenCut-app:mainfrom
kcfancher:feature/fix-transcription-sample-rate
Open

Fix transcription sample-rate handling#740
kcfancher wants to merge 1 commit intoOpenCut-app:mainfrom
kcfancher:feature/fix-transcription-sample-rate

Conversation

@kcfancher
Copy link

@kcfancher kcfancher commented Mar 13, 2026

Fix for #703.

Adds an optional sampleRate parameter to the decodeAudioToFloat32() function. The caption transcriber passes in a value of 16000 to prepare audio in the format Whisper expects.

⚠️ READ BEFORE SUBMITTING ⚠️

We are not currently accepting PRs except for critical bugs.

If this is a bug fix:

  • I've opened an issue first
  • This was approved by a maintainer

If this is a feature:

This PR will be closed. Please open an issue to discuss first.

Summary by CodeRabbit

  • Bug Fixes
    • Standardized audio sample rate for transcription processing to improve consistency and reliability of audio decoding across the application.

Fix for OpenCut-app#703.

Adds an optional sampleRate parameter to the decodeAudioToFloat32() function. The caption transcriber passes in a value of 16000 to prepare audio in the format Whisper expects.
@vercel
Copy link

vercel bot commented Mar 13, 2026

@kcfancher is attempting to deploy a commit to the OpenCut OSS Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d93d4858-2409-4007-8100-77042e96919f

📥 Commits

Reviewing files that changed from the base of the PR and between 26d523e and dad7e78.

📒 Files selected for processing (3)
  • apps/web/src/components/editor/panels/assets/views/captions.tsx
  • apps/web/src/constants/transcription-constants.ts
  • apps/web/src/lib/media/audio.ts

📝 Walkthrough

Walkthrough

These changes add explicit sample rate specification for audio transcription. A new constant defines the default transcription sample rate of 16000 Hz, and audio decoding functions are updated to accept and utilize this rate when preparing audio for transcription.

Changes

Cohort / File(s) Summary
Sample Rate Configuration
apps/web/src/constants/transcription-constants.ts
Added new exported constant DEFAULT_TRANSCRIPTION_SAMPLE_RATE = 16000 to define a standard audio sample rate for transcription operations.
Audio Decoding Integration
apps/web/src/lib/media/audio.ts, apps/web/src/components/editor/panels/assets/views/captions.tsx
Updated decodeAudioToFloat32 function to accept optional sampleRate parameter; captions component now passes DEFAULT_TRANSCRIPTION_SAMPLE_RATE when decoding audio for transcription workflows.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through audio streams so fine,
With sample rates all perfectly aligned,
Sixteen thousand times per second's beat,
The transcription magic is now complete!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix transcription sample-rate handling' clearly and concisely summarizes the main change: adding sample-rate handling to the transcription functionality.
Description check ✅ Passed The description includes the issue reference, a clear explanation of the change, and confirmation of bug-fix checklist items (issue opened, maintainer approval).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

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