Skip to main content

High-level TTS with voice rotation and mood selection for content creators

Project description

easy-edge-tts

High-level TTS with voice rotation and mood selection for content creators

PyPI version Python 3.10+ License: MIT

easy-edge-tts makes text-to-speech dead simple. Built on top of Edge TTS (free, high-quality Microsoft voices), it adds voice rotation, mood-based selection, and word-level timestamps - everything content creators need.

Features

  • Free - Uses Microsoft Edge TTS (no API key needed)
  • 20+ voices - Male, female, US, UK, Australian accents
  • Mood-based selection - Pick voices that match your content
  • Voice rotation - Automatic variety across multiple generations
  • Word timestamps - Perfect for synchronized subtitles
  • Async-first - Built for modern Python

Installation

pip install easy-edge-tts

For ElevenLabs support (premium voices):

pip install easy-edge-tts[elevenlabs]

Quick Start

Simple One-Liner

from easy_edge_tts import speak

await speak("Hello world!", "output.mp3")

Choose a Voice

from easy_edge_tts import EdgeTTS

# Use a specific voice
tts = EdgeTTS(voice="aria")  # Expressive, dramatic female
result = await tts.generate("The tension was unbearable...", "drama.mp3")

print(f"Generated {result.duration:.1f}s of audio")

Mood-Based Selection

from easy_edge_tts import VoiceRotator

rotator = VoiceRotator()

# Get a voice that matches the mood
tts = rotator.get_tts_for_mood("dramatic")
await tts.generate("And then... everything changed.", "scene.mp3")

# Available moods: dramatic, suspense, scary, happy, sad, news, tutorial, podcast, aita, revenge, heartwarming, shocking

Voice Rotation for Variety

from easy_edge_tts import VoiceRotator

rotator = VoiceRotator()

stories = ["Story one...", "Story two...", "Story three..."]

for i, story in enumerate(stories):
    # Each story gets a different voice
    tts = rotator.get_next_tts()
    await tts.generate(story, f"story_{i}.mp3")

Word-Level Timestamps (for subtitles)

from easy_edge_tts import EdgeTTS

tts = EdgeTTS(voice="guy")
result, timestamps = await tts.generate_with_timestamps(
    "This is perfect for creating synchronized subtitles.",
    "output.mp3"
)

for word in timestamps:
    print(f"{word['start']:.2f}s - {word['end']:.2f}s: {word['text']}")

Available Voices

Name Gender Accent Best For
guy Male US Storytelling, warm narratives
jenny Female US Friendly, versatile content
aria Female US Dramatic, emotional content
davis Male US Professional, authoritative
ryan Male UK British, formal content
sonia Female UK British, warm professional
thomas Male UK Deep, serious, dramatic

See all 20+ voices →

Mood Categories

Perfect for content creators who need the right voice for their content:

Mood Best Voices Use Case
dramatic aria, guy, ryan Reddit stories, drama
suspense aria, thomas, davis Thriller content
happy jenny, sara, tony Upbeat content
news davis, nancy, ryan News, reports
aita guy, aria, jenny "Am I The A-hole" stories
tutorial jenny, guy, sara How-to videos

Adjust Speed and Pitch

from easy_edge_tts import EdgeTTS

tts = EdgeTTS(voice="guy")

# Faster for short-form content
await tts.generate("Quick update!", "fast.mp3", rate="+20%")

# Slower for dramatic effect
await tts.generate("And then...", "slow.mp3", rate="-30%")

# Higher pitch
await tts.generate("Exciting news!", "high.mp3", pitch="+10Hz")

ElevenLabs (Premium)

For the most natural-sounding voices:

from easy_edge_tts import ElevenLabsTTS

tts = ElevenLabsTTS(
    api_key="your-api-key",
    voice_id="your-voice-id"
)

result = await tts.generate("Premium quality voice.", "premium.mp3")

Requirements

  • Python 3.10+
  • ffprobe (optional, for accurate duration detection)
# Ubuntu/Debian
sudo apt install ffmpeg

# macOS
brew install ffmpeg

# Windows
# Download from https://ffmpeg.org/download.html

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - feel free to use in your projects!


Made for content creators

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_edge_tts-0.4.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_edge_tts-0.4.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file easy_edge_tts-0.4.0.tar.gz.

File metadata

  • Download URL: easy_edge_tts-0.4.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for easy_edge_tts-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e6ae451a931572ca7b727700e39b5dbc493cca66b1e848b60d6eadfbb9e95f65
MD5 b337be8c1405eea2326a830bb5e5432b
BLAKE2b-256 1f4d91af9998759d2e4a74d34b0c0989905e7922591931627dcc5237b61aa869

See more details on using hashes here.

File details

Details for the file easy_edge_tts-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: easy_edge_tts-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for easy_edge_tts-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f981bd4c2fbbb8fd58d0fbb0b6dc6c69018b7416868965ce978f38465776b7
MD5 76b7564059f0939bb59533d224a63612
BLAKE2b-256 355b806ecc19dca0a500167ade783658334ed33f0ca316f5ae72c88a3a4700bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page