You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(audio): route WhisperKit capture via inputDeviceID (our fork), drop default-swap
Replaces the system-default capture-and-restore workaround for the WhisperKit
streaming path with the clean upstream mechanism: pin WhisperKit to OUR fork
(initcore0/argmax-oss-swift) at v1.0.0 + a single-file backport of upstream PR
argmaxinc/argmax-oss-swift#503, which threads an optional `inputDeviceID` through
`AudioStreamTranscriber` to `AudioProcessor.startRecordingLive(inputDeviceID:)`.
Why fork instead of pinning the upstream PR branch: that branch is diverged from
v1.0.0 (8 ahead / 1 behind, ~60 files incl. the CoreML AudioEncoder/TextDecoder/
FeatureExtractor paths the 1.0.0 pin + GPU-encoder choice deliberately hold
stable on macOS 26) and lives on a personal fork we don't control. Our fork
branch (openwhisp/v1.0.0-input-device) is v1.0.0 + ONLY the 4-line device patch,
pinned by immutable commit. When #503 lands in a tagged upstream release we bump
and delete the fork.
Engine changes:
- WhisperKitBridge.makeStreamHandle takes `inputDeviceID: AudioDeviceID?` and
passes it to AudioStreamTranscriber(inputDeviceID:).
- WhisperKitStreamingEngine resolves the selected UID to an AudioDeviceID and
passes it through — deleting the DefaultInputOverride engage/poll/restore dance
and the isCapturing() helper. Unresolved (incl. a resolve→nil TOCTOU) stays a
hard error, never a silent default capture.
- DefaultInputOverride remains in AudioInputRouter, now used ONLY by the legacy
AVAudioRecorder path (which genuinely can only capture the system default).
Verified on live hardware against the actual forked WhisperKit lib (linked as the
app links it): AudioProcessor.startRecordingLive(inputDeviceID:) started the
engine bound to a non-default device (id 243) while the system default (id 110)
stayed UNCHANGED — direct per-device capture, no swap. Fresh-clone resolve pulls
the fork at the pinned commit and builds; ./build.sh green; swift test 435/435.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments