feat(mobile): add on-device Pocket TTS - #3290
Draft
johnmatthewtennant wants to merge 5 commits into
Draft
Conversation
Signed-off-by: John Tennant <jtennant@squareup.com>
Signed-off-by: John Tennant <jtennant@squareup.com>
Signed-off-by: John Tennant <jtennant@squareup.com>
Signed-off-by: John Tennant <jtennant@squareup.com>
Contributor
Author
johnmatthewtennant
added a commit
that referenced
this pull request
Jul 28, 2026
Signed-off-by: John Tennant <jtennant@squareup.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Context
Buzz Desktop can speak submitted assistant responses with the local Pocket TTS engine. Mobile had no equivalent, so voice playback required a separate product path or a network service.
Summary
This PR adds private, on-device Pocket TTS to Buzz Mobile. It reuses the shared
buzz-voiceengine and desktop text preparation, keeps the engine warm in a Dart worker isolate, downloads the 473 MB FP32 model after install, and integrates native audio behavior on iOS and Android.Changes
buzz-voice-mobileC ABI for persistent engine create/destroy, cancellable synthesis, PCM ownership, and shared chunk preparation.buzz-voiceso desktop and mobile use the same text cleanup, sentence grouping, padding, clamp, and fade behavior.AVAudioSessionfor spoken playback and Android audio focus, routes, interruptions, and boundedAudioTrackdraining.Related issue
N/A. No matching issue or PR was found.
Testing
cargo test -p buzz-voice -p buzz-voice-mobile: 38 shared voice tests and 2 ABI tests passed.cargo clippy -p buzz-voice -p buzz-voice-mobile --all-targets -- -D warnings: passed.flutter test: 844 tests passed, 1 expected skip../gradlew :app:testDebugUnitTest: passed, 303 tasks completed../scripts/mobile-voice-native.sh build-ios: passed for iOS device arm64 and simulator arm64/x86_64../scripts/mobile-voice-native.sh build-android: passed for Android arm64-v8a and x86_64.xcodebuild: passed.Screenshots
The Pocket Voice settings state is attached in the screenshot comment generated by the repository screenshot workflow.
Reviewer-reproducible examples
Android end to end
Use an Android emulator or device with at least 1 GB of free application storage:
Observed on the isolated arm64 emulator:
The test downloads and verifies every model asset, creates the resident engine, asserts 24 kHz mono signed-16-bit PCM, performs a warm synthesis, exercises native playback, and verifies prompt cancellation.
Native packaging
./scripts/mobile-voice-native.sh build-ios ANDROID_NDK_HOME="$ANDROID_SDK_ROOT/ndk/28.2.13676358" \ ./scripts/mobile-voice-native.sh build-androidObserved output:
Shared engine contract
cargo test -p buzz-voice -p buzz-voice-mobile cargo clippy -p buzz-voice -p buzz-voice-mobile --all-targets -- -D warningsObserved output:
Notes