generate-voice
v1.0.0
Published
Generate voice audio from text using free Microsoft TTS — no API key needed
Downloads
142
Maintainers
Readme
generate-voice
Generate voice audio from text using free Microsoft TTS — no API key needed.
400+ voices in 100+ languages. One command. Free and unlimited.
Quick Start
npx generate-voice "Hello, how are you?"That's it. You get an .mp3 file.
Prerequisites
- Node.js >= 14
- Python 3 with pip (edge-tts is auto-installed on first run)
Usage
Generate speech
# Default voice (en-US-GuyNeural)
npx generate-voice "Hello world"
# Choose a voice
npx generate-voice "Bonjour le monde" --voice fr-FR-HenriNeural
# Save to specific file
npx generate-voice "Hello" --output greeting.mp3
# Adjust speed
npx generate-voice "This is fast" --rate "+30%"
npx generate-voice "This is slow" --rate "-20%"
# Adjust pitch
npx generate-voice "Higher pitch" --pitch "+5Hz"
npx generate-voice "Lower pitch" --pitch "-5Hz"
# Combine options
npx generate-voice "Custom voice" --voice en-GB-SoniaNeural --rate "+10%" --output custom.mp3Browse voices
# List all 400+ voices
npx generate-voice --voices
# Filter by language
npx generate-voice --voices --lang en # English
npx generate-voice --voices --lang fr # French
npx generate-voice --voices --lang de # German
npx generate-voice --voices --lang ja # Japanese
npx generate-voice --voices --lang es # SpanishSetup (optional)
npx generate-voice setupChecks Python 3 and installs edge-tts. This runs automatically on first use, but you can run it manually to verify your environment.
Options
| Flag | Description | Default |
|------|-------------|---------|
| -v, --voice <name> | TTS voice name | en-US-GuyNeural |
| -o, --output <file> | Output file path | Auto from text |
| -r, --rate <rate> | Speech rate (+20%, -10%) | Normal |
| -p, --pitch <pitch> | Voice pitch (+5Hz, -2Hz) | Normal |
| --voices | List all available voices | — |
| -l, --lang <code> | Filter voice list by language | — |
Popular Voices
| Voice | Language | Gender |
|-------|----------|--------|
| en-US-GuyNeural | English (US) | Male |
| en-US-JennyNeural | English (US) | Female |
| en-US-AriaNeural | English (US) | Female |
| en-GB-SoniaNeural | English (UK) | Female |
| en-GB-RyanNeural | English (UK) | Male |
| fr-FR-HenriNeural | French | Male |
| de-DE-ConradNeural | German | Male |
| es-ES-AlvaroNeural | Spanish | Male |
| ja-JP-KeitaNeural | Japanese | Male |
| zh-CN-XiaoxiaoNeural | Chinese | Female |
How It Works
Uses edge-tts, a Python library that accesses Microsoft Edge's free text-to-speech API. No API key, no account, no limits.
License
MIT
