refactor(voice): extract reusable Pocket voice primitives - #2467
Draft
johnmatthewtennant wants to merge 8 commits into
Draft
refactor(voice): extract reusable Pocket voice primitives#2467johnmatthewtennant wants to merge 8 commits into
johnmatthewtennant wants to merge 8 commits into
Conversation
johnmatthewtennant
force-pushed
the
jt/buzz-voice-refactor
branch
from
July 27, 2026 23:06
81f9ee8 to
8ac609c
Compare
| @@ -0,0 +1,654 @@ | |||
| //! Pocket TTS engine wrapper around sherpa-onnx's `OfflineTts`. | |||
Contributor
Author
There was a problem hiding this comment.
🤖 This implementation is mechanically moved from desktop/src-tauri/src/huddle/pocket.rs at exact parent d8f9d87c17131b952ea5b6c3767978c4637545fc. Reproduce the whitespace-tolerant comparison from the repository root:
diff -uw \
<(git show d8f9d87c17131b952ea5b6c3767978c4637545fc:desktop/src-tauri/src/huddle/pocket.rs) \
crates/buzz-voice/src/pocket.rsActual residual diff:
(no output)
This was referenced Jul 27, 2026
johnmatthewtennant
force-pushed
the
jt/buzz-voice-refactor
branch
from
July 28, 2026 00:28
8ac609c to
c9dfe50
Compare
johnmatthewtennant
force-pushed
the
jt/buzz-voice-refactor
branch
from
July 28, 2026 13:48
91eaee8 to
a3c16e7
Compare
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
Signed-off-by: John Tennant <[email protected]>
johnmatthewtennant
force-pushed
the
jt/buzz-voice-refactor
branch
from
July 28, 2026 14:30
a3c16e7 to
0f97b7e
Compare
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 owned Pocket TTS inference inside huddle, so other Buzz clients had to copy engine configuration and prompt behavior. The original extraction at
3e9dd6d3dacc6011838cec1302e4301039355378passed host validation, but unchanged consumers failed for both iOS and Android because the crates.iosherpa-onnx-sysbuild script rejects mobile targets.The mobile support here is a general
buzz-voicepackaging and API contract. It does not add a Buzz Mobile bridge, app behavior, model, or native binary.Summary
This PR moves the existing Pocket engine and tests into a reusable
buzz-voiceworkspace crate, preserves the existing synchronous API, and adds:staticandsharednative-link features, with static remaining the default;sherpa-onnx-sys1.13.4;SHERPA_ONNX_LIB_DIR.Desktop keeps its existing huddle module surface through a compatibility re-export.
Changes
crates/buzz-voicewith the existing Pocket engine implementation and 13 tests.desktop/src-tauri/src/huddle/pocket.rs.synth_chunk_with_callback(text, lang, style, steps, Option<F>);synth_chunkremains unchanged and delegates with no callback.buzz-voicefeatures tosherpa-onnx/staticandsherpa-onnx/sharedwith upstream defaults disabled.sherpa-onnx-sys1.13.4 FFI sources, license, andCargo.toml.orig; only its build script and a short README provenance note differ intentionally.log.0.0.1package.No native libraries or models are bundled.
Related issue
None found.
Testing
Red/green mobile evidence:
3e9dd6d3dacc6011838cec1302e4301039355378, the same downstream Berd bridge passed host tests but failed iOS and Android preparation withUnsupported target for sherpa-onnx prebuilt libs.41b06a494ebd49ee0b4ea8435afab725d669b01f, all four Docker builds failed because cargo-chef 0.1.71 rewrote the workspace copy ofsherpa-onnx-systo version0.0.1, conflicting with the registry package's uniquelinks = "sherpa-onnx".0f97b7ef6d2f9aa87dea9a639223c39d9f0f9066. Both Docker builders keep the patch outside the masked workspace recipe and copy its real 1.13.4 source tree before dependency cooking. Downstream repins and platform revalidation are coordinated against this SHA.Local gates on the frozen voice/package diff (unchanged by the final Docker-only commits):
cargo fmt --all -- --check: passed.cargo test --locked -p buzz-voice --all-targets: 13 passed.cargo check: passed.cargo clippyforbuzz-voicestatic and vendoredsherpa-onnx-syswith-D warnings: passed.cargo packageforbuzz-voiceandsherpa-onnx-sys: passed.cargo deny check licenses: passed.sherpa-onnx-sysconflict. Final GitHub Docker builds are the authoritative image gate.origin/main4a977c588a540be38bd8ddb268cd24437bac8165. Desktop release metadata remains version0.5.0, the desktop manifest and lock retain thebuzz-voicedependency, stable feature patch identity remains3ee9d574c9072042a7c64b16248357c74cbc32ef, and the post-rebase NCMB review was clean.Screenshots
N/A. This is a Rust API and native-link packaging change with no UI.
Reviewer-reproducible examples
Run the extracted engine tests:
cargo test --locked -p buzz-voice --all-targetsExercise both host link modes:
With an official sherpa-onnx 1.13.4 mobile library directory prepared by the caller:
Cross-repository consumers must pin both the public crate and the patched sys crate to the same canonical SHA: