Skip to content

About

CLI toolkit for crafting consistent, multi-language character voices with ElevenLabs AI + vintage radio post-processing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Character Voices

A CLI toolkit for creating consistent, multi-language character voices using ElevenLabs Voice Design API with vintage radio post-processing.

Built with the principle that voice traits are language-agnostic — the same character should sound recognizably similar across English, Spanish, and any future language. Only accent/dialect changes per language.

How It Works

Research Character → Define Voice Traits → Generate Voices → Refine TTS → Speak
  1. Research a character deeply (personality, voice actor, speech patterns, catchphrases)
  2. Define core voice traits once (pitch, timbre, pace, energy, personality) — these stay the same across all languages
  3. Configure languages with accent/dialect specifics (e.g., Transatlantic English, Neutral LATAM Spanish)
  4. Generate voice previews via ElevenLabs Voice Design v3 — 3 variations per run
  5. Save the best voice to your ElevenLabs library
  6. Refine TTS settings with an automated generate → analyze → score loop
  7. Speak any text in character, with optional post-processing effects

Quick Start

Prerequisites

  • Python 3.10+
  • ElevenLabs API key (Creator plan or above for Voice Design)
  • FFmpeg (for audio processing)

Install

# Clone the repo
git clone https://github.com/yourusername/charactervoices.git
cd charactervoices

# Install Python dependencies
pip install pedalboard scipy numpy

# Set up your API key
echo "ELEVENLABS_API_KEY=your_key_here" > .env

Create Your First Character

# 1. Initialize a character
python3 voice_designer.py create "Alastor"

# 2. Edit characters/alastor/character.json with research + voice traits + languages
#    (see the Example Character section below)

# 3. Preview the voice description that will be sent to ElevenLabs
python3 voice_designer.py preview-desc Alastor --lang en

# 4. Generate voice previews (3 variations)
python3 voice_designer.py design Alastor --lang en

# 5. Listen to previews in characters/alastor/previews/
#    Pick your favorite (1, 2, or 3)

# 6. Save to ElevenLabs library
python3 voice_designer.py save Alastor en_v1 1

# 7. Generate speech with the saved voice
python3 voice_designer.py speak Alastor --lang en -t "Hello, my dear!"

Commands

Command Description
create <name> Initialize a new character with empty profile
design <name> --lang <code> Generate 3 voice previews for a language
refine <name> --lang <code> Auto-test TTS configurations, pick the best
speak <name> --lang <code> -t "text" Generate speech with a saved voice
analyze <name> <file> Verify language/accent with speech-to-text
save <name> <iteration> <1-3> Save a preview to ElevenLabs voice library
show <name> View character profile and all iterations
list List all characters
radio-fx <input> [--preset medium] Apply vintage radio effect to any audio file
batch-fx <name> [--preset medium] Apply radio-fx to all previews for a character
preview-desc <name> --lang <code> Preview the generated voice description

Command Options

# Design with custom settings
python3 voice_designer.py design Alastor --lang es-latam \
  --guidance 15 --prompt-strength 0.2 --reference en_v1_preview_1.mp3

# Refine with custom text
python3 voice_designer.py refine Alastor --lang es-latam \
  -t "Vaya, vaya, que sorpresa tan deliciosa."

# Speak with radio effect override
python3 voice_designer.py speak Alastor --lang en \
  -t "Welcome to the show!" --fx heavy

# Radio-fx standalone
python3 voice_designer.py radio-fx input.mp3 -o output.mp3 --preset subtle

Supported Languages

Code Language Default Accent
en English Standard American English
es-latam Spanish (Latin America) Neutral LATAM dubbing accent (Mexican)
es-es Spanish (Spain) Castilian Spanish
pt-br Portuguese (Brazil) Brazilian Portuguese
fr French Standard Parisian French
de German Standard High German
ja Japanese Standard Tokyo dialect
ko Korean Seoul dialect
it Italian Standard Italian

Character Profile Structure

Each character lives in characters/<name>/character.json:

{
  "name": "Alastor",
  "source": "Hazbin Hotel",
  "research": {
    "sources": ["https://hazbinhotel.fandom.com/wiki/Alastor"],
    "summary": "The Radio Demon, an Overlord of Hell...",
    "voice_actor": "Amir Talai (Amazon series)",
    "catchphrases": ["Smile, my dear!"],
    "sample_dialogue": ["Allow me to introduce myself..."]
  },
  "voice_traits": {
    "gender": "Male",
    "age": "30s",
    "pitch": "deep baritone, resonant low register",
    "timbre": "smooth, velvety, rich",
    "pace": "measured and theatrical with dramatic pauses",
    "energy": "perpetually amused, dangerously charming",
    "quality": "Broadcast quality",
    "personality_voice": "charismatic vintage radio showman",
    "distinctive_features": [
      "Crisp enunciation of a 1930s radio host",
      "Even threats sound entertained"
    ]
  },
  "design_settings": {
    "model_id": "eleven_ttv_v3",
    "guidance_scale": 15,
    "reference_audio": null,
    "prompt_strength": 0.3
  },
  "post_processing": {
    "radio_fx": "medium"
  },
  "languages": {
    "en": {
      "accent": "Transatlantic Mid-Atlantic accent",
      "description_prefix": "Native English speaker.",
      "extra_notes": "Think a golden-age radio host who is dangerously charming.",
      "preview_text": "Well, well, well! What a delightful surprise...",
      "iterations": []
    }
  },
  "saved_voices": {},
  "refine_results": {}
}

Key Concepts

  • voice_traits — Language-agnostic. Defines the character's voice identity. Same across all languages.
  • languages.<code>.accent — Language-specific accent/dialect for that locale.
  • design_settings.reference_audio — Use an English preview as reference when generating other languages, to keep the voice consistent.
  • design_settings.prompt_strength — Controls reference audio influence (lower = more reference influence, 0.1-0.3 recommended).
  • post_processing.radio_fx — Auto-applied to all design and speak outputs. Guarantees consistent sound character across languages.

Radio FX Post-Processing

The radio_fx.py module applies a vintage 1930s AM radio effect using Spotify's Pedalboard. Three presets are available:

Preset Bandwidth Drive Character
subtle 200-6000Hz 4dB Light warmth, slight bandwidth reduction
medium 300-4000Hz 8dB Clear radio character — the sweet spot
heavy 400-3000Hz 14dB Full 1930s AM radio, narrow + noisy

Signal chain:

  1. Mono conversion (no stereo in the 1930s)
  2. High-pass filter (remove sub-bass rumble)
  3. Low-pass filter (AM radio bandwidth ceiling)
  4. Tube-style saturation (warm harmonic distortion)
  5. Broadcast compression (squashed dynamics)
  6. Limiter (prevent clipping)
  7. Midrange presence boost (nasal, forward radio sound)
  8. Wow & flutter (mechanical instability)
  9. Atmospheric noise (hiss + random crackle impulses)
  10. Final limiter

This is applied identically across all languages, solving the problem of ElevenLabs generating inconsistent radio textures for different languages.

Automated Refinement

The refine command tests 5 TTS configurations and scores them using ElevenLabs' speech-to-text (Scribe v2):

python3 voice_designer.py refine Alastor --lang es-latam

Each configuration is scored 0-100 on:

  • Language match (30 pts) — Did STT detect the correct language?
  • Confidence (25 pts) — How confident is the language detection?
  • Text accuracy (35 pts) — How well did STT transcribe vs. input text?
  • Audio quality (10 pts) — Penalizes excessive audio artifacts

The winning config is saved to refine_results in the character profile and automatically used by speak.

Configurations tested:

  1. eleven_multilingual_v2 / conservative (high stability, no style)
  2. eleven_multilingual_v2 / balanced (medium stability, light style)
  3. eleven_v3 / no language hint
  4. eleven_v3 / with language hint + conservative
  5. eleven_v3 / with language hint + expressive

Project Structure

charactervoices/
  voice_designer.py      # Main CLI — all commands
  radio_fx.py            # Vintage radio post-processing (Pedalboard)
  .env                   # ElevenLabs API key (not in git)
  characters/
    alastor/
      character.json     # Character profile, iterations, saved voices
      previews/          # Generated voice previews + radio-fx versions
      references/        # Reference audio files
      output/            # speak command outputs
      refine/            # Refinement test outputs

Lessons Learned

Cross-Language Consistency

ElevenLabs Voice Design has no language/locale parameter — accent is controlled entirely through the voice_description text. This means:

  • The model has strong training data associations for "English + 1930s radio" but not for "Spanish + 1930s radio"
  • Radio texture effects don't transfer across languages from the description alone
  • Solution: Use English voice as reference_audio for other languages + identical post-processing

Reference Audio for Other Languages

When generating a Spanish (or any non-English) voice for an existing English character:

  1. Generate the English voice first
  2. Use the best English preview as reference_audio when designing the other language
  3. Set prompt_strength low (0.1-0.3) so the reference audio has more influence on voice quality
  4. The voice description handles the language/accent; the reference audio handles the timbre/character

TTS Text Formatting Matters

  • Periods create hard stops — use dashes (—) and commas for flowing speech
  • Missing accent marks (Spanish: é, í, ó, á, ú, ñ) cause pronunciation hesitation
  • Exclamation marks add energy and emphasis
  • Short sentences with periods sound robotic — connect them with commas or dashes

TTS Model Selection

  • eleven_multilingual_v2 — More stable accent, better for non-English. Recommended for LATAM Spanish.
  • eleven_v3 — Higher quality English, but can drift accents in other languages (e.g., Colombian instead of Mexican Spanish with high style values)
  • The refine command automates finding the best model + settings combo.

Voice Settings for Character Voices

Per ElevenLabs docs, for dramatic character voices:

  • stability: 0.25-0.5 (lower = more expressive, higher = more consistent)
  • similarity_boost: 0.8-0.9 (keep the designed voice)
  • style: 0.0-0.3 (higher values can cause accent drift in non-English)
  • use_speaker_boost: true

Dependencies

  • pedalboard — Spotify's audio effects library (for radio-fx)
  • scipy — Signal processing (midrange EQ boost)
  • numpy — Array operations for audio processing
  • No requests dependency — uses Python's built-in urllib for API calls

License

MIT

About

CLI toolkit for crafting consistent, multi-language character voices with ElevenLabs AI + vintage radio post-processing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages