Webscout's TTS Providers offer a versatile and powerful text-to-speech conversion library with support for multiple providers and advanced features.
- Multiple TTS Providers: Support for various text-to-speech services
- Concurrent Audio Generation: Efficiently process long texts
- Flexible Voice Selection: Choose from a wide range of voices
- Robust Error Handling: Comprehensive logging and error management
- Caching Mechanism: Automatically cache generated audio files
- Cross-Platform Compatibility: Works seamlessly across different environments
- ElevenlabsTTS
- GesseritTTS
- MurfAITTS
- ParlerTTS
- DeepgramTTS
- StreamElementsTTS
- VoicepodsTTS
pip install webscout
from webscout.Provider.TTS import ElevenlabsTTS
# Initialize the TTS provider
tts = ElevenlabsTTS()
# Generate speech from text
text = "Hello, this is a test of text-to-speech conversion."
audio_file = tts.tts(text, voice="Brian")
# Play the generated audio
tts.play_audio(audio_file)
Each TTS provider offers multiple voices:
# List available voices
print(tts.all_voices.keys())
# Select a specific voice
audio_file = tts.tts(text, voice="Alice")
Enable detailed logging for debugging:
audio_file = tts.tts(text, verbose=True)
- Supports multiple English voices
- Multilingual text-to-speech
- Offers unique voice characteristics
- Supports voice description customization
- Provides specific voice models
- Supports custom voice descriptions
- Uses Gradio Client for TTS generation
- Supports large and small model variants
- Multiple voice options
- Advanced voice selection
- Wide range of international voices
- Simple and straightforward API
- Efficient audio caching
try:
audio_file = tts.tts(text)
except exceptions.FailedToGenerateResponseError as e:
print(f"TTS generation failed: {e}")
# Use with proxy
tts = ElevenlabsTTS(proxies={
'http': 'http://proxy.example.com:8080',
'https': 'https://proxy.example.com:8080'
})