Feat/unified engines streaming word events - #2
Merged
Conversation
… 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
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.
No description provided.