pyt2s
v0.0.4
The Python Text to Speech library you've been looking for (maybe not).
Note: This is a toy project
A simple python library to convert texts to voice using different TTS services.
This python library is heavily inpired from Chris Phillips's php tts library. I wanted to use a Python TTS library for one of my projects, but I found none that is simply plug-and-play, supports multiple voices, includes both genders, and doesn’t require me to download trained models of tens of GBs.
pip install pyt2sfrom pyt2s.services import stream_elements
# Default Voice
data = stream_elements.requestTTS('Lorem Ipsum is simply dummy text.')
# Custom Voice
data = stream_elements.requestTTS('Lorem Ipsum is simply dummy text.', stream_elements.Voice.Russell.value)
with open('output.mp3', '+wb') as file:
file.write(data)