Migushthe2nd/MsEdgeTTS
A simple Azure Speech Service module that uses the Microsoft Edge Read Aloud API. https://migushthe2nd.github.io/MsEdgeTTS/
What it is
MsEdgeTTS is a Node‑JS library that lets you generate speech audio by calling Microsoft Edge’s built‑in Read Aloud service (the same service Azure Speech uses). It builds the required SSML, opens a WebSocket to the Edge API, and streams back the synthesized audio.
Why it matters
- No Azure key needed – it re‑uses the free Edge Read Aloud endpoint, so you can get neural‑quality TTS without a cloud subscription.
- Streaming output – audio is returned as a Node stream, which is handy for real‑time playback or piping into other tools.
- Fine‑grained control – you can pick voice, output format, rate, pitch, volume, and even request word‑ and sentence‑boundary metadata.
- Works server‑side – the API now requires an Edge‑style user‑agent, so it runs in Node (or any server‑side runtime) but not in other browsers.
How to use it (quick start)
import {MsEdgeTTS, OUTPUT_FORMAT} from "msedge-tts";
const tts = new MsEdgeTTS();
await tts.setMetadata(
"en-US-AriaNeural", // voice
OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS // audio codec
);
// Stream audio directly
const {audioStream} = tts.toStream("Hello world!");
audioStream.on('data', chunk => console.log('audio chunk', chunk));
You can also write straight to a file with toFile(), adjust rate/pitch/volume via the optional options object, or supply a custom HTTP/SOCKS proxy agent.
Key features
| Feature | Details |
|---|---|
| Voice selection | Pass any Edge voice identifier (e.g., en-IE-ConnorNeural). |
| Output formats | Several WebM/Opus, MP3, OGG, etc., defined in OUTPUT_FORMAT. |
| SSML support | Generates basic SSML with <speak>, <voice>, and <prosody> tags. |
| Boundary metadata | Optional word‑ and sentence‑boundary events returned as a separate stream or file. |
| Timeout handling | Configurable connection and synthesis timeouts; emits errors on the audio stream. |
| Proxy support | Accepts a custom http.Agent (e.g., https-proxy-agent, socks-proxy-agent). |
| Promise‑based API | All methods return promises; streams emit standard Node events. |
Who might use it
- Developers building voice assistants, bots, or IVR systems that need quick TTS without Azure billing.
- Content creators who want to batch‑generate narration files server‑side.
- Researchers prototyping speech‑enabled applications where low‑latency streaming is useful.
- Anyone needing word‑level timing data for lip‑sync or subtitle generation.
All information is taken directly from the repository’s README; no additional features are assumed.
Related
- Project
- Project
- Project
- Project
- Project