Skip to content

fix: recover empty short Whisper transcriptions - #255

Merged
jatinkrmalik merged 2 commits into
VocaHQ:mainfrom
Mr-Sunglasses:fix/whisper-short-audio
Sep 5, 2026
Merged

fix: recover empty short Whisper transcriptions#255
jatinkrmalik merged 2 commits into
VocaHQ:mainfrom
Mr-Sunglasses:fix/whisper-short-audio

Conversation

@Mr-Sunglasses

@Mr-Sunglasses Mr-Sunglasses commented Sep 5, 2026

Copy link
Copy Markdown
Member

Problem

WhisperKit defaults to excluding one second at the end of a decoding window. Its decode loop runs only while seek < end - windowPadding, so recordings of one second or less never enter the loop and return empty text. A current-source Tiny reproduction returned empty for a 0.498-second synthetic “Hello” recording.

Changes

Set windowClipTime to zero for clips of at most 16,000 samples (one second at 16 kHz). Longer clips retain WhisperKit's default trailing-window protection. Short speech is decoded directly using the original samples and duration, with no additional padding or retry. Existing vocabulary recovery and no-speech filtering remain in place.

Validation

  • 14 focused Whisper service tests passed, including decode-loop eligibility at one sample, sub-second lengths, exactly one second, and preservation of default options above the boundary.
  • Live Tiny CLI: the original 0.498-second fixture and exactly one-second fixture both returned Hello. with their original durations.
  • Digital silence was rejected by the existing CLI audio validation.
  • App compiled as part of swift test; git diff --check passed.
  • Full suite before self-review: 444 tests, one environment-dependent skip, no failures. The revised code received the focused checks above; CI reruns on the new commit.

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for voca-mac canceled.

Name Link
🔨 Latest commit 32294c5
🔍 Latest deploy log https://app.netlify.com/projects/voca-mac/deploys/6a9b60f65be7de00089707d9

@github-actions github-actions Bot added app ci and removed ci labels Sep 5, 2026
@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR changes short-clip Whisper transcription to enter the decode loop by removing the trailing exclusion window for audio at or below one second.

  • Selects a zero-second clip window for up to 16,000 samples while preserving WhisperKit’s default for longer recordings.
  • Adds boundary-focused tests for short and longer sample counts.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
Sources/VocaMac/Services/WhisperService.swift Configures the WhisperKit trailing exclusion window according to the input sample count.
Tests/VocaMacTests/WhisperServiceTests.swift Adds boundary tests covering decode-loop eligibility and preservation of the longer-clip default.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Whisper audio samples] --> B{Sample count ≤ 16,000?}
    B -->|Yes| C[Set windowClipTime to 0]
    B -->|No| D[Keep one-second window]
    C --> E[Run WhisperKit transcription]
    D --> E
Loading

Reviews (2): Last reviewed commit: "fix: decode short Whisper clips without ..." | Re-trigger Greptile

@jatinkrmalik

Copy link
Copy Markdown
Member

@Mr-Sunglasses thanks, this looks good. Merging.

@jatinkrmalik
jatinkrmalik merged commit 9132ab7 into VocaHQ:main Sep 5, 2026
10 checks passed
@Mr-Sunglasses
Mr-Sunglasses deleted the fix/whisper-short-audio branch September 5, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants