Edge TTS
Direct Node.js client for Microsoft Edge's online TTS service. The canonical client is scripts/say.mjs; scripts/say.sh is the shell entrypoint wrapper. There are no Python, CLI-wrapper, or legacy shell fallbacks.
Usage
./scripts/say.sh "Привет" ru +30% # Synthesize and play with an available local MP3 player
./scripts/say.sh "Привет" ru 1 /tmp/hello.mp3 # Save MP3; numeric rate multiplier is supported
./scripts/say.sh "Привет" ru +30% /tmp/a.mp3 /tmp/a.jsonl
./scripts/say.sh --text "Hello" --lang en --write-media /tmp/hello.mp3
./scripts/say.sh --file input.txt --voice ru-RU-SvetlanaNeural --write-media out.mp3 --write-subtitles out.srt
./scripts/say.sh --list-voices
CLI Options
--text, --file — text source; - means stdin for files.
--lang, --voice — language shortcut or explicit voice.
--rate, --volume, --pitch — Edge prosody controls.
--boundary — SentenceBoundary or WordBoundary.
--write-media — MP3 output path; - means stdout.
--write-subtitles — SRT output path; - means stderr.
--write-metadata — JSONL boundary metadata output path.
--list-voices — direct voice list request.
Playback
Playback runs in background only when no media output path is provided. The client auto-detects a local MP3 player and removes the temp file after playback when the player is blocking.
Default candidates:
- Cross-platform if installed:
ffplay, mpv, vlc/cvlc.
- Linux/BSD extras:
mpg123.
- macOS default:
afplay.
- Windows default fallback: the system-registered MP3 app through PowerShell
Start-Process.
If no player exists, generation is still available through --write-media; the agent can then play the MP3 with any system-specific tool. Windows default-app playback uses delayed temp cleanup because registered apps usually detach immediately.
Dependencies
- Node.js 18+.
- A local MP3 player only for direct playback mode.
- Internet access.
Notes
- Built-in language shortcuts: en, ru, de, fr, es, it, zh, ja.
- Default rate: +30%.
- Rate/volume accept Edge percent strings and numeric multipliers:
1 = +100%, 0.8 = +80%, -0.5 = -50%.
- The script implements direct TLS/WebSocket handshake, MUID, Sec-MS-GEC, MP3 streaming, boundary metadata, subtitles, and voice listing.
1---2name: edge-tts3description: Text-to-speech via Microsoft Edge TTS (free, neural voices).4---56# Edge TTS78Direct Node.js client for Microsoft Edge's online TTS service. The canonical client is `scripts/say.mjs`; `scripts/say.sh` is the shell entrypoint wrapper. There are no Python, CLI-wrapper, or legacy shell fallbacks.910## Usage1112```bash13./scripts/say.sh "Привет" ru +30% # Synthesize and play with an available local MP3 player14./scripts/say.sh "Привет" ru 1 /tmp/hello.mp3 # Save MP3; numeric rate multiplier is supported15./scripts/say.sh "Привет" ru +30% /tmp/a.mp3 /tmp/a.jsonl16./scripts/say.sh --text "Hello" --lang en --write-media /tmp/hello.mp317./scripts/say.sh --file input.txt --voice ru-RU-SvetlanaNeural --write-media out.mp3 --write-subtitles out.srt18./scripts/say.sh --list-voices19```2021## CLI Options2223- `--text`, `--file` — text source; `-` means stdin for files.24- `--lang`, `--voice` — language shortcut or explicit voice.25- `--rate`, `--volume`, `--pitch` — Edge prosody controls.26- `--boundary` — `SentenceBoundary` or `WordBoundary`.27- `--write-media` — MP3 output path; `-` means stdout.28- `--write-subtitles` — SRT output path; `-` means stderr.29- `--write-metadata` — JSONL boundary metadata output path.30- `--list-voices` — direct voice list request.3132## Playback3334Playback runs in background only when no media output path is provided. The client auto-detects a local MP3 player and removes the temp file after playback when the player is blocking.3536Default candidates:3738- Cross-platform if installed: `ffplay`, `mpv`, `vlc`/`cvlc`.39- Linux/BSD extras: `mpg123`.40- macOS default: `afplay`.41- Windows default fallback: the system-registered MP3 app through PowerShell `Start-Process`.4243If no player exists, generation is still available through `--write-media`; the agent can then play the MP3 with any system-specific tool. Windows default-app playback uses delayed temp cleanup because registered apps usually detach immediately.4445## Dependencies4647- Node.js 18+.48- A local MP3 player only for direct playback mode.49- Internet access.5051## Notes5253- Built-in language shortcuts: en, ru, de, fr, es, it, zh, ja.54- Default rate: +30%.55- Rate/volume accept Edge percent strings and numeric multipliers: `1` = `+100%`, `0.8` = `+80%`, `-0.5` = `-50%`.56- The script implements direct TLS/WebSocket handshake, MUID, Sec-MS-GEC, MP3 streaming, boundary metadata, subtitles, and voice listing.