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.3.0.tar.gz (11.8 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.3.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easy_edge_tts-0.3.0.tar.gz
  • Upload date:
  • Size: 11.8 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.3.0.tar.gz
Algorithm Hash digest
SHA256 0c26f13733fdc60c76434132930b4fd26ac20c988b17cf21a1768d1d5b7d87ed
MD5 4698bf37f034c17451be40fa8cf2d742
BLAKE2b-256 c4285f37a8fd3562b0051b04448304fd6b2395dec1b9fad1e259ed25d40b588b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: easy_edge_tts-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 977558fa87236ff870f4d014859b7e673a89e4db3f02f645f5fef0b2f752f9cb
MD5 1217b8df1c5202542dc41261c9f15499
BLAKE2b-256 38cd2e9a99bf7cacacd10fcd37a4192d01fdd6b9c67fc19a4c48ebe8aeec64d2

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