ai-tts
v1.2.0
Published
AI audio content creation CLI — stories, podcasts, narration, and dubbing with TTS
Maintainers
Readme
ai-tts
AI audio content creation CLI — stories, podcasts, narration, and TTS synthesis.
Quick Start
# Synthesize a single sentence
npx ai-tts say "你好世界"
# Output as MP3 (smaller file size)
npx ai-tts say "你好世界" --format mp3
# Generate a story with TTS narration
npx ai-tts story --topic "三只小猪"
# Browse available voices
npx ai-tts voices --search "温柔"A browser window will open for login on first use. After that, your token is cached automatically.
Install
npm install -g ai-ttsCommands
ai-tts say <text> / ai-tts synthesize <text>
Synthesize a single text snippet to audio.
ai-tts say "你好世界"
ai-tts say "你好世界" --format mp3
ai-tts synthesize "Welcome" --voice v-male-Bk7vD3xP --format mp3
ai-tts say "快速测试" --speed 1.5 --volume 0.8 --pitch 2| Flag | Default | Description |
|------|---------|-------------|
| <text> | (required) | Text to synthesize (positional or --text) |
| --voice <id> | v-female-R2s4N9qJ | TTS voice ID |
| --format <fmt> | pcm | Output format: pcm (WAV), wav, mp3 |
| --speed <n> | 1.0 | Speed 0.5-2.0 |
| --volume <n> | 1.0 | Volume 0.1-2.0 |
| --pitch <n> | 0 | Pitch -12 to 12 |
| --output <path> | ./tts-<timestamp>.wav | Output file path |
ai-tts narrate [options]
Narrate a document, text, or script to multi-segment audio.
ai-tts narrate --input article.txt
ai-tts narrate --input article.txt --format mp3
ai-tts narrate --input readme.md --voice v-male-Bk7vD3xP
ai-tts narrate --text "第一段。第二段。第三段。"
ai-tts narrate --script narration-script.json
echo "Hello world" | ai-tts narrate| Flag | Default | Description |
|------|---------|-------------|
| --input <file> | | Input .txt or .md file |
| --text <text> | | Inline text to narrate |
| --script <file> | | JSON script with per-segment voice control |
| --voice <id> | v-female-R2s4N9qJ | Default voice ID |
| --format <fmt> | pcm | Output format: pcm (WAV), wav, mp3 |
| --speed <n> | 1.0 | Speed 0.5-2.0 |
| --silence <sec> | 0.8 | Silence between segments 0-5.0 |
| --output <path> | ./narration-<timestamp>.wav | Output file path |
Script JSON format (per-segment voice/speed control):
{
"segments": [
{ "text": "第一段内容", "voiceId": "v-female-R2s4N9qJ", "speed": 1.0 },
{ "text": "第二段内容", "voiceId": "v-male-Bk7vD3xP", "speed": 0.8 }
],
"silence": 1.0,
"output": "my-narration.wav"
}ai-tts voices [options]
Browse and filter available TTS voices (no login required).
ai-tts voices
ai-tts voices --search "温柔" --gender female
ai-tts voices --language en --extended
ai-tts voices --json| Flag | Default | Description |
|------|---------|-------------|
| --search <query> | | Search by name, tone, style |
| --gender <m\|f> | | Filter by gender |
| --language <code> | | Filter by language: zh, en, etc. |
| --extended | false | Include extended voice library (380+) |
| --json | false | Output raw JSON |
ai-tts story [options]
Generate a story with AI and synthesize TTS audio.
ai-tts story --topic "小红帽的故事"
ai-tts story --topic "太空探险" --paragraphs 8 --speed 0.8| Flag | Default | Description |
|------|---------|-------------|
| --topic <text> | Children's story | Story prompt |
| --voice <id> | v-female-R2s4N9qJ | TTS voice ID |
| --output <path> | ./story-<timestamp>.wav | Output WAV file |
| --paragraphs <n> | 5 | Number of paragraphs (1-20) |
| --speed <n> | 1.0 | Speed (0.5-2.0) |
| --silence <sec> | 0.8 | Silence between paragraphs (0-5.0) |
ai-tts podcast [options]
Generate a multi-speaker podcast dialogue.
ai-tts podcast --topic "AI趋势" --exchanges 10
ai-tts podcast --topic "科技新闻" --style casual --length long| Flag | Default | Description |
|------|---------|-------------|
| --topic <text> | Tech trends | Podcast topic |
| --style <style> | professional | Dialogue style |
| --length <len> | medium | short / medium / long |
| --exchanges <n> | 8 | Number of exchanges (2-30) |
| --output <path> | ./podcast-<timestamp>.wav | Output WAV file |
| --speed <n> | 1.0 | Speed (0.5-2.0) |
| --silence <sec> | 0.5 | Silence between segments (0-5.0) |
ai-tts login / logout / status / dashboard
ai-tts login # Open browser to login via email OTP
ai-tts logout # Clear cached token
ai-tts status # Show login status and token info
ai-tts dashboard # Open Web dashboard in browserAuthentication
AI-TTS uses browser-based email OTP login (Supabase):
- CLI starts a temporary local HTTP server
- Opens your browser to the login page
- You enter your email and verification code
- Browser redirects back to the CLI with your token
- Token is cached at
~/.config/ai-tts/token.json
Quota
- Free tier: 100 quota per day
say/synthesize: 1 quota per callnarrate: 1 quota per segmentstory: ~6-8 quota (1 LLM + N TTS)podcast: ~10-20 quotavoices: free (no quota)- Quota resets daily
Requirements
- Node.js >= 18.0.0
License
UNLICENSED - All rights reserved.
