Skip to content

Transcribe a selected audio track in local video and media - #56

Merged
rudrankriyam merged 10 commits into
mainfrom
auralkit-2.2-video-track
Nov 13, 2026
Merged

rudrankriyam merged 10 commits into
mainfrom
auralkit-2.2-video-track

Conversation

@rudrankriyam

@rudrankriyam rudrankriyam commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Add streamTranscription(fromMediaFile:audioTrackID:options:) for local video and audio on iOS and macOS 27. A caller can select an AVAssetTrack by ID or use the first audio track. AuralKit preserves media timestamps, rejects external references and invalid track IDs, and closes the stream when the analyzer receives no samples. File read errors reach the caller even when cancelling the Speech results reader makes it return normally.

Targeted for 2.2. In a real Mac run using a two-track MP4, the public API transcribed the first track at 0.00 s and the second at 1.92 s, with distinct text and the session returning to idle both times. All 66 package tests, strict SwiftLint, and both demo builds passed.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 149545c. Configure here.

do {
try Task.checkCancellation()
guard inputProviderPreference == .automatic else {
throw MediaTranscriptionConfigurationError()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Private error skips SpeechSessionError

Medium Severity

A non-automatic inputProviderPreference now throws private MediaTranscriptionConfigurationError instead of SpeechSessionError. Callers that catch SpeechSessionError (as the public docs describe) miss this failure, and the type is not visible outside the module so it cannot be handled by name.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 149545c. Configure here.

let detached = detachTranscriberState()
await stopScreenCaptureStreamingIfNeeded()
await finalizeDetachedTranscriberState(detached)
await finalizeDetachedTranscriberState(detached, cancelAnalysis: cancelMediaAnalysis)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stop cancel limited to media

High Severity

cleanup now calls cancelAndFinishNow() only when streamingMode is .mediaPlayback. finalizeAndFinishThroughEndOfInput() waits for input that never arrives if setup is cancelled before the analyzer is started, so stopTranscribing() can hang for live or file sessions during preparing (including model download). The hang test was retargeted to media, so that path is no longer covered.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 149545c. Configure here.

@rudrankriyam
rudrankriyam marked this pull request as ready for review November 13, 2026 13:18
@rudrankriyam
rudrankriyam merged commit 2bd51e5 into main Nov 13, 2026
2 checks passed
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