gemini-tts
Skill12 starsChanged 6 months agoMITView on GitHub
Generate speech from text using Google Gemini TTS. Use when creating voiceovers, narration, podcasts, or any text-to-speech task. Supports 70+ languages, style/emotion control via natural language prompts, and 30 prebuilt voices. Trigger on "Gemini TTS", "Google TTS", "voiceover", "narration", "text to speech", "speech generation".
- Reads credentials
- Installs packages
5 other projects use a version of this.
Adopted by
Most recently taken up by
- akrindev/google-studio-skillstheir own version, first seen Nov 8, 2026
- iurysza/agent-skillstheir own version, first seen Nov 1, 2026
- brandonbryant12/clearframetheir own version, first seen Oct 20, 2026
- sonichi/sutandotheir own version, first seen May 17, 2026
- Panastra-labs/skillstheir own version, first seen Mar 4, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- sonichi/sutando★ 396same name
- akrindev/google-studio-skills★ 7same name
- iurysza/agent-skills★ 5same name
- brandonbryant12/clearframe★ 1same name
- Panastra-labs/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- product-launch-videoSkill
The file
Files
Gemini Text-to-Speech
Generate natural, expressive speech from text using Google Gemini TTS. Supports 70+ languages, 30 prebuilt voices, and style control via natural language prompts and audio tags.
Requirements: Node.js 18+, ffmpeg,
@google/genainpm package,GEMINI_API_KEYenv var.
Available Scripts
scripts/generate-tts.mjs— All-in-one TTS generator with single-request consistency, silence-based splitting, and automatic trimming.
Quick Start
Single text to speech
npm install @google/genai
GEMINI_API_KEY=your-key node scripts/generate-tts.mjs \
--text "Hello, welcome to our product!" \
--output-dir public/vo \
--voice KoreMulti-segment voiceover (consistent voice)
Create a segments.json:
[
{ "id": "intro", "text": "Welcome to our product launch." },
{ "id": "features", "text": "Here are the three features you will love." },
{ "id": "close", "text": "Get started today at our website." }
]Run:
GEMINI_API_KEY=your-key node scripts/generate-tts.mjs \
--segments segments.json \
--output-dir public/vo \
--voice Kore \
--director-notes "Tone: Warm, confident, inspiring. Style: Professional narrator with a vocal smile. Accent: Neutral American English. Pacing: Moderate."Output (JSON to stdout):
{
"success": true,
"segments": [
{ "id": "intro", "file": "public/vo/vo-intro.mp3", "duration": 3.25 },
{ "id": "features", "file": "public/vo/vo-features.mp3", "duration": 4.10 },
{ "id": "close", "file": "public/vo/vo-close.mp3", "duration": 2.80 }
],
"totalDuration": 10.15,
"fullAudioFile": "public/vo/vo-full.wav"
}Script Options
| Flag | Default | Description |
--segments FILE | — | JSON file with [{id, text}] segment definitions |
--text TEXT | — | Single text to generate (alternative to --segments) |
--output-dir DIR | — | Output directory for audio files (required) |
--voice NAME | Kore | Prebuilt voice name (see Voices table) |
--model NAME | gemini-3.1-flash-tts-preview | Gemini TTS model ID |
--director-notes TEXT | — | Performance guidance: style, pacing, accent, breathing, articulation. Does not control gender/age (use --voice for that). |
--retries N | 3 | Max retry attempts for API errors |
--trim / --no-trim | --trim | Trim silence from segment boundaries |
--format FORMAT | mp3 | Output format: mp3 or wav |
Exit Codes
| Code | Meaning |
| 0 | Success |
| 1 | Missing required arguments or env vars |
| 2 | API error after retries exhausted |
| 3 | ffmpeg not installed or processing failed |
| 4 | File I/O error |
How It Works (Multi-Segment)
Gemini TTS does NOT guarantee voice consistency across separate API requests. The script solves this by:
- Combining all segments into ONE prompt with
[3 second pause]markers between them - Generating a single continuous audio file in one API call
- Detecting silence gaps with ffmpeg
silencedetectusing adaptive thresholds (starts at noise=-35dB, d=1.5s, progressively relaxes). If an exact match is found, uses it directly. If a threshold jump occurs (too few → too many), regenerates audio with faster speech pacing to make inter-segment pauses more distinct, then retries detection. - Splitting at silence midpoints into individual segment files
- Trimming residual silence padding (~1.5s per side) from each segment, keeping 0.15s breathing room
Models
| Model | Best For |
gemini-3.1-flash-tts-preview | Latest, most controllable, 200+ audio tags (default) |
gemini-2.5-flash-preview-tts | Fast, good quality, general use |
gemini-2.5-pro-preview-tts | Highest quality, complex performances |
Voices
30 prebuilt voices:
| Voice | Gender | Character | Pitch |
| Achernar | Female | Soft | Higher |
| Achird | Male | Friendly | Lower middle |
| Algenib | Male | Gravelly | Lower |
| Algieba | Male | Smooth | Lower |
| Alnilam | Male | Firm | Lower middle |
| Aoede | Female | Breezy | Middle |
| Autonoe | Female | Bright | Middle |
| Callirrhoe | Female | Easy-going | Middle |
| Charon | Male | Informative | Lower |
| Despina | Female | Smooth | Middle |
| Enceladus | Male | Breathy | Lower |
| Erinome | Female | Clear | Middle |
| Fenrir | Male | Excitable | Lower middle |
| Gacrux | Female | Mature | Middle |
| Iapetus | Male | Clear | Lower middle |
| Kore | Female | Firm | Middle |
| Laomedeia | Female | Upbeat | Higher |
| Leda | Female | Youthful | Higher |
| Orus | Male | Firm | Lower middle |
| Puck | Male | Upbeat | Middle |
| Pulcherrima | Male | Forward | Middle |
| Rasalgethi | Male | Informative | Middle |
| Sadachbia | Male | Lively | Lower |
| Sadaltager | Male | Knowledgeable | Middle |
| Schedar | Male | Even | Lower middle |
| Sulafat | Female | Warm | Middle |
| Umbriel | Male | Easy-going | Lower middle |
| Vindemiatrix | Female | Gentle | Middle |
| Zephyr | Female | Bright | Higher |
| Zubenelgenubi | Male | Casual | Lower middle |
Director's Notes (--director-notes)
Performance guidance for the selected voice. Define only what matters — overspecifying limits the model's creativity and can worsen results.
The three most common directions are Style, Pacing, and Accent, but you can include any custom instructions relevant to the performance.
- Style — Emotional quality and delivery character. Be descriptive:
"Infectious enthusiasm — the listener should feel part of something exciting"works better than just"energetic". You can layer characteristics and use voiceover industry terms like "vocal smile". - Pacing — Overall speed and rhythm variation. Can range from
"Speak as fast as possible"to"Incredibly slow and liquid, words bleed into each other, zero urgency". - Accent — Be specific.
"British English as heard in Croydon, England"works much better than"British accent".
--director-notes "Style: Enthusiastic and sassy GenZ beauty YouTuber. Pacing: Extremely fast, rapid delivery like short-form video influencers. Accent: Southern California valley girl from Laguna Beach."Audio Tags
Inline [brackets] in segment text for per-word control. Override director-notes locally.
[whispers] [shouting] [excited] [serious] [short pause] [laughs] [very fast] [very slow] [sarcastic] [curious]
Creative tags work too: [like dracula], [whispering conspiratorially]
Example: "[excited] This changes everything! [short pause] Let me show you how."
References
- Prompting Guide — Advanced prompt engineering for style, emotion, and accent
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

