Skip to content

Feat/unified engines streaming word events - #2

Merged
willwade merged 5 commits into
mainfrom
feat/unified-engines-streaming-word-events
Jun 2, 2026
Merged

Feat/unified engines streaming word events#2
willwade merged 5 commits into
mainfrom
feat/unified-engines-streaming-word-events

Conversation

@willwade

@willwade willwade commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

willwade added 5 commits June 1, 2026 23:11
… engines

Major overhaul to match js-tts-wrapper and swift-tts-wrapper:

- Unified Voice struct with language_codes array, provider field,
  normalized gender (matching JS UnifiedVoice and Swift UnifiedVoice)
- Azure engine: proper SSML generation with XML escaping, voice
  selection, prosody tags (rate/pitch), Content-Type headers
- Google engine: correct REST API with JSON body, base64 audio decode,
  v1beta1 timepoint support for real word boundaries via SSML marks
- Voice enumeration for Azure, Google, ElevenLabs, Cartesia and
  other engines with list APIs
- Word boundary support via estimate_word_boundaries() matching
  the Swift WordTimingEstimator algorithm (150 WPM, length-adjusted)
- All engines now fire on_boundary callbacks with estimated timings
- Added base64 dependency for Google audio decoding
- Updated tests: 30 tests (10 unit + 20 integration) covering all
  engines, voice struct, word boundaries, gender normalization
- Updated README with new capabilities table and architecture docs
- Add speechmarkdown-rust dependency (from AACTools/speechmarkdown-rust)
- Auto-detect and convert SpeechMarkdown to SSML before synthesis,
  using platform-specific output (Azure, Google, Alexa)
- Fix cbindgen build.rs to warn instead of panic on parse errors
- Add unit tests for speech markdown preprocessing and passthrough
- Add integration tests for speech markdown across platforms
…ause/resume, check_credentials

Match Swift TTSClient protocol API surface:
- SpeakOptions struct with rate/pitch/volume/voice/format/
  useSpeechMarkdown/useWordBoundary/rawSSML/extra fields
- SpeechRate and SpeechPitch named presets (xSlow..xFast)
- AudioFormat enum (mp3/wav/ogg/opus/aac/flac/pcm)
- Gender typed enum replacing raw String
- pause()/resume() on TtsEngine trait (default no-op)
- check_credentials() using get_voices as validation
- speak_with_options() and synth_to_bytes_with_options()
- Configurable words_per_minute in word boundary estimator
- Fix cloud-only build: #[cfg] gates on system/sherpaonnx modules
- 10 new tests for types, options, and boundary estimation
…ce, and updated bindings

- README: accurate per-engine table (streaming, voice list, word boundaries,
  speech markdown support)
- Full Rust API reference: TtsEngine trait, SpeakOptions, Voice, WordBoundary,
  callbacks, factory, utility functions
- Full C API reference: all 17 exported functions
- Code examples for C, Rust, Python, .NET, Swift
- Python binding: add speak_sync, set_pitch, set_volume, on_audio callback,
  on_boundary callback with proper ctypes types
- .NET binding: add speak_sync, delegate types for audio/boundary callbacks
- Swift binding: add speakSync, stop, setVoice, setRate, setPitch, setVolume
- ci.yml: lint, clippy, test, cloud-only build, C header artifact
- publish.yml: triggered on v* tags and workflow_dispatch
  - version sync from git tag to Cargo.toml
  - test gate (clippy + test + cloud-only build)
  - cross-platform native builds: Windows x64/arm64, macOS x64/arm64,
    Linux x64/arm64 (shared + static libraries)
  - crates.io publish with CARGO_REGISTRY_TOKEN
  - GitHub Release with all native libraries + C header
  - Adapted from speechmarkdown-rust publish workflow
@willwade
willwade merged commit a04ecd5 into main Jun 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant