Speech Engine
Speech Engine is a Python package that provides a simple interface for synthesizing text into speech using different TTS engines, including Google Text-to-Speech (gTTS) and Wit.ai Text-to-Speech (Wit TTS).
Installation
You can install speech-engine
using pip:
pip install speech-engine
Usage
TTS_GOOGLE
from speech_engine import TTS_Google, FileExtensionError
tts = TTS_Google()
tts.set_language('en')
tts.set_slow(False)
tts.speak("Hello, world!")
try:
tts.save("Hello, world!", "output.mp3")
except FileExtensionError as e:
print(e.message)
TTS_Witai
from speech_engine import TTS_Witai
tts = TTS_Witai(your_authtoken)
tts.set_voice('Colin')
tts.speak("Hello, world!")
tts.save("Hello, world!", "output.mp3")
voices = tts.get_voices()
print(voices)
TTS_Openai
from speech_engine import TTS_Openai
tts = TTS_Openai(your_apikey)
tts.set_voice('alloy')
tts.speak("Hello, world!")
tts.save("Hello, world!", "output.mp3")
voices = tts.get_voices()
print(voices)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub.