Catalog
fairoosansar-coder/tts-generation

fairoosansar-coder

tts-generation

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

v1.0LATEST
NewUpdated Oct 29, 2026

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

Argument Default Description
--workspace workspace Root workspace directory
--workers 8 Max 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:

Speaker Voice Audio Treatment
Paul (host) Puck Clean — no filter
Caller [Female] — 1st Kore Telephone filter
Caller [Female] — 2nd Aoede Telephone filter
Caller [Male] — 1st Charon Telephone filter
Caller [Male] — 2nd Fenrir Telephone 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
Files1
1 files · 11.1 KB

Select a file to preview

Overall Score

78/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

76

Quality

82

Clarity

79

Completeness

73

Summary

This skill generates TTS audio from a radio show script using the Gemini Interactions API, assigning voices dynamically based on gender tags and applying a simulated telephone bandpass filter to correspondent voices while keeping the host's audio clean. The accompanying Python script orchestrates parallel TTS generation with retries, post-processing via ffmpeg, and WAV concatenation.

Detected Capabilities

file readfile writeshell executionhttp requestapi callexternal command execution (ffmpeg)environment variable read

Trigger Keywords

Phrases that agents use to match this skill to user intent.

radio show ttstelephone effect audiotext to speech voicescorrespondent voice filtermulti-speaker audio generation

Risk Signals

WARNING

Environment variable read: GEMINI_API_KEY

scripts/generate_tts.py:154
INFO

External subprocess execution (ffmpeg) for audio processing

scripts/generate_tts.py:108-119
INFO

Network API calls to Google Gemini service via google-genai SDK

scripts/generate_tts.py:94-106
WARNING

Fallback 'dummy-key' default for GEMINI_API_KEY if unset

scripts/generate_tts.py:154

Referenced Domains

External domains referenced in skill content, detected by static analysis.

www.apache.org

Use Cases

  • Convert radio show scripts to speech audio with distinct voice effects
  • Apply telephone filter effects to simulate phone call-in segments
  • Generate multi-speaker audio with parallel TTS processing
  • Create radio show content with professional host voice and simulated caller voices
  • Automate TTS generation with retry logic and dynamic voice assignment

Quality Notes

  • Strong error handling with retry logic (up to 3 attempts with exponential backoff) for TTS generation failures
  • Clear voice assignment strategy with dynamic gender-based voice mapping and fallback accent defaults
  • Well-documented speaker profiles (Paul vs. default caller) with contextual audio direction notes
  • Comprehensive script parsing supports gender tags ([Male]/[Female]), accent tags ([Accent: ...]), and boost tags
  • Clear output specification: WAV format, 24kHz, 16-bit PCM, mono with intermediate segments retained for debugging
  • Good separation of concerns: TTS generation, filtering, and concatenation are independent functions
  • Parallel processing with ThreadPoolExecutor reduces latency for large scripts
  • Risk: fallback dummy API key value may cause silent failures if GEMINI_API_KEY is not set in environment
  • Missing validation: script_path existence is not checked before opening, will raise FileNotFoundError if data/script.md missing
  • Segments directory creation is idempotent (os.makedirs with exist_ok=True), good defensive practice
Model: claude-haiku-4-5-20251001Analyzed: Oct 29, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use fairoosansar-coder/tts-generation in your dev environment

Command Palette

Search for a command to run...