mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
What changed
- KeyboardParakeet.transcribe falls back to Apple's speech recognition (which streams the
file) when the recording is longer than KeyboardParakeetBudget.longestAudio (90 s), or when
the room left (os_proc_available_memory) doesn't cover the transcription headroom (24 MB)
plus 0.5 MB per second of audio (transcribeHeadroom(audioSeconds:)). Each reason is logged
like the other fallbacks ("parakeet: dictation engine=apple (longer than 90 s)", "... (short
of memory for N s of audio)"). The person sees nothing different: Apple's text arrives a
moment later.
- allowsTranscription takes the recording's length.
Why
- FluidAudio reads the whole recording into memory before it transcribes (the 48 kHz file
as floats, a copy of it and the 16 kHz result, AudioConverter.resampleAudioFile): measured
in Hex's keyboard at about 0.42 MB a second (7.9 MB for 18.9 s). With the keyboard
recording at 74-91 MB once the model is loaded, three to four minutes of speech reached
the iPhone 17 Pro's 177 MB limit, and less on a phone with a lower limit: iOS would end the
keyboard mid-transcription and the dictation would be lost. The fixed 24 MB check before
didn't grow with the recording.
- 90 s: 45 MB of audio at 0.5 MB a second, which with the 91 MB recording and the 16 MB
transcription leaves 25 MB under 177 MB on the phone we measured, a margin the room check
alone can't promise if memory moves while it runs. Almost every dictation is far shorter.
Verified
- DictationControllerTests: the room for 60 s is 54 MB; on the iPhone 17 Pro's keyboard at
91 MB, 60 s and 90 s go to Parakeet and 91 s to Apple; with 50 MB left, 40 s goes to
Parakeet and 60 s to Apple; the cap holds where iOS sets no limit. The existing budget
cases pass with their lengths. Studio suite and the pull request's head in the PR.
|
||
| .. | ||
| CleanupTagger | ||
| TypingModel | ||
| AppleLiveTranscriber.swift | ||
| ContainingAppOpener.swift | ||
| HEXKeyboard.entitlements | ||
| Info.plist | ||
| KeyboardInputView.swift | ||
| KeyboardLiveDictation.swift | ||
| KeyboardLiveTyping.swift | ||
| KeyboardLocalDictation.swift | ||
| KeyboardParakeet.swift | ||
| KeyboardViewController.swift | ||
| ParakeetLiveTranscriber.swift | ||
| PrivacyInfo.xcprivacy | ||