tts-generation

Convert radio show script to speech audio with telephone effect on correspondent voices using the Interactions API.

npx skills add https://github.com/google-gemini/gemini-managed-agents-templates --skill tts-generation

TTS Generation

Convert the radio show script into speech audio using the Gemini TTS model via the Interactions API. Apply a telephone bandpass filter to correspondent voices so they sound like phone call-ins, while keeping the host's voice clean studio-quality.

Embedded Script

python3 skills/tts-generation/scripts/generate_tts.py --workspace ./workspace

Arguments

ArgumentDefaultDescription
--workspaceworkspaceRoot workspace directory
--workers8Max parallel TTS worker threads

What it does

  1. Reads the script from {workspace}/data/script.md.
  2. Parses it into individual (speaker, text) turns and assigns voices.
  3. Generates TTS for all turns in parallel using a thread pool (default 8 workers).
  4. Retries each failed turn up to 3 times with exponential backoff.
  5. Applies an ffmpeg telephone bandpass filter (300Hz–3.4kHz) to correspondent voices.
  6. Keeps the host (Paul) audio clean and unfiltered.
  7. Concatenates all segments in original script order into a single WAV.

Dependencies

  • google-genai (>= 2.0.0)
  • ffmpeg (system)

API Details

Uses the Interactions API with single-speaker TTS — no multi-speaker workaround needed.

Voice Assignment

Voices are assigned dynamically based on [Male] / [Female] gender tags in the script:

SpeakerVoiceAudio Treatment
Paul (host)PuckClean — no filter
Caller [Female] — 1stKoreTelephone filter
Caller [Female] — 2ndAoedeTelephone filter
Caller [Male] — 1stCharonTelephone filter
Caller [Male] — 2ndFenrirTelephone filter

Voices cycle round-robin if there are more callers than available voices. Accent tags ([Accent: Irish], etc.) are injected into the TTS prompt to influence pronunciation.

Telephone Filter

Applied via ffmpeg to correspondent audio segments:

highpass=f=300, lowpass=f=3400, acompressor, volume=1.5

This simulates the standard telephone bandwidth (300Hz–3.4kHz) and adds compression to mimic phone codec dynamics.

Output

  • Primary output: {workspace}/audio/speech/speech.wav
  • Format: WAV, 24kHz, 16-bit PCM, mono
  • Intermediate segments: {workspace}/audio/speech/segments/turn_*.wav

Más skills de google-gemini

greeter
google-gemini
Una habilidad de saludo amigable
official
code-reviewer
google-gemini
Revisión automatizada de código para cambios locales y solicitudes de extracción remotas con análisis estructurado en corrección, mantenibilidad y seguridad. Admite cambios en el sistema de archivos local (preparados y no preparados) y PRs remotos (por número o URL) con verificación automática mediante GitHub CLI. Analiza el código en siete dimensiones: corrección, mantenibilidad, legibilidad, eficiencia, seguridad, manejo de casos límite y cobertura de pruebas. Ejecuta conjuntos de verificación previa opcionales (por ejemplo, npm run preflight) para detectar...
official
review-duplication
google-gemini
Usa esta habilidad durante las revisiones de código para investigar de manera proactiva el código base en busca de funcionalidades duplicadas, ruedas reinventadas o fallos en la reutilización de elementos existentes…
official
reconciliation
google-gemini
Reconcile loaded expenses against the pre-parsed invoice database, flagging discrepancies like amount mismatches, missing invoices, and merchant mismatches…
official
gemini-api-cli
google-gemini
Guide for using the Gemini API CLI tool. Use when you need to interact with the Gemini API via the command line, manage agents, or generate media (images,…
official
agent-tui
google-gemini
Main Agents: Do NOT use this skill directly. If you need to test the TUI, invoke the `tui_tester` subagent. Drive terminal UI (TUI) applications…
official
async-pr-review
google-gemini
Activa esta habilidad cuando el usuario quiera iniciar una revisión asíncrona de PR, ejecutar verificaciones en segundo plano en un PR o consultar el estado de una revisión asíncrona de PR iniciada previamente…
official
behavioral-evals
google-gemini
Guía para crear, ejecutar, corregir y promover evaluaciones conductuales. Úsese al verificar la lógica de decisión del agente, depurar fallos, depurar indicaciones…
official