kothok-edge-tts
A Microsoft Edge online text-to-speech client for Rust.
It replicates the Edge browser "Read Aloud" WebSocket protocol against
speech.platform.bing.com, including the rotating Sec-MS-GEC DRM token, and
returns the same neural voices the browser uses (e.g.
en-US-EmmaMultilingualNeural, bn-BD-NabanitaNeural) as streaming MP3 frames
plus word-boundary metadata for highlighting.
Features
- Same neural voices & SSML as Edge's Read Aloud.
- Pure Rust (no native deps);
tokio+tokio-tungstenite+rustls. - Swappable backend via the
Enginetrait. - Word-boundary offsets for sentence/word highlighting.
- Connect skew-retry (handles clock drift → 403).
Quick start
async
The Engine trait
use Engine;
EdgeTts implements Engine; implement it yourself to mock or swap backends.
Important: token rotation
This targets the undocumented consumer endpoint that Edge's Read Aloud
uses. Microsoft rotates the SEC_MS_GEC_VERSION constant on Edge release
cycles; when it goes stale every synthesis returns HTTP 403. When that happens,
re-pin SEC_MS_GEC_VERSION in src/edge_tts.rs and publish a new version.
License
MIT (LICENSE).