hex/ios/HEXKeyboard
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 5467eca7d0
iOS keyboard: a long dictation goes to Apple's engine instead of Parakeet, which holds it all in memory (#2412)
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.
2026-11-22 13:47:38 -05:00
..
CleanupTagger iOS: clean up what I say with an on-device tagger (experiment) (#2023) 2026-11-20 01:29:41 +00:00
TypingModel English typing model: contractions as common as their words, and Hex's chat and tech words (#2408) 2026-11-22 13:40:28 -05:00
AppleLiveTranscriber.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
ContainingAppOpener.swift Open Hex from the iPhone keyboard and show live keyboard setup (#599) 2026-10-31 09:56:02 -07:00
HEXKeyboard.entitlements Set up Hex Mobile internal TestFlight releases (#1997) 2026-11-19 11:48:49 -05:00
Info.plist iOS: plainer interface wording (copy pass) (#2345) 2026-11-22 03:45:00 -05:00
KeyboardInputView.swift iOS keyboard: stop leaking views, capture web views, and emoji indices across shows (#2352) 2026-11-22 06:45:38 -05:00
KeyboardLiveDictation.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
KeyboardLiveTyping.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
KeyboardLocalDictation.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
KeyboardParakeet.swift iOS keyboard: a long dictation goes to Apple's engine instead of Parakeet, which holds it all in memory (#2412) 2026-11-22 13:47:38 -05:00
KeyboardViewController.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
ParakeetLiveTranscriber.swift iOS keyboard: Show what I say and Type as I speak (words while you dictate) (#2410) 2026-11-22 13:37:37 -05:00
PrivacyInfo.xcprivacy iOS: version 1.0, iPhone only, privacy manifests (#2052) 2026-11-20 15:54:01 +00:00