Skip to main content

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

# Instantiate TTS_Google
tts = TTS_Google()

# Set the language and other options
tts.set_language('en')
tts.set_slow(False)

# Synthesize and play speech
tts.speak("Hello, world!")

# Synthesize and save speech as an audio file
try:
    tts.save("Hello, world!", "output.mp3")
except FileExtensionError as e:
    print(e.message)

TTS_Witai

from speech_engine import TTS_Witai

# Instantiate TTS_Witai with the Wit.ai auth token
tts = TTS_Witai(your_authtoken)

# Set the voice
tts.set_voice('Colin')

# Synthesize and play speech
tts.speak("Hello, world!")

# Synthesize and save speech as an audio file
tts.save("Hello, world!", "output.wav")


# Get available voices
voices = tts.get_voices()
print(voices)

TTS_Openai

from speech_engine import TTS_Openai

# Instantiate TTS_Openai with the Openai Api key
tts = TTS_Openai(your_apikey)

# Set the voice
tts.set_voice('alloy')

# Synthesize and play speech
tts.speak("Hello, world!")

# Synthesize and save speech as an audio file
tts.save("Hello, world!", "output.mp3")

# Get available voices
voices = tts.get_voices()
print(voices)

TTS_Deepgram

from speech_engine import TTS_Deepgram

# Instantiate TTS_Openai with the Openai Api key
tts = TTS_Deepgram(your_apikey)

# Set the voice
tts.set_voice('aura-angus-en')

# Synthesize and play speech
tts.speak("Hello, world!")

# Synthesize and save speech as an audio file
tts.save("Hello, world!", "output.wav")


# Get available voices
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.

Metadata

Release files for speech-engine 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speech-engine 0.2.0
File Size Uploaded
speech_engine-0.2.0.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for speech-engine 0.2.0
File Interpreter ABI Platform
speech_engine-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / speech_engine-0.2.0.tar.gz

Download URL speech_engine-0.2.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e63fcc2ac5602520158606252ce4e33cb4caf324a031dde08edd3b334934963f
BLAKE2b-256 checksum
How to use checksums
fb6273d0a0cacbd54b2a1d9ded3568e0766ecf989cdb14c967bed6a4133b1b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / speech_engine-0.2.0-py3-none-any.whl

Download URL speech_engine-0.2.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63a5749df2ffd6e83c903396028b2e67cf2089c1aefafc53798d10c4987fefc5
BLAKE2b-256 checksum
How to use checksums
5ee639454643b2f9195dbafcade6917dd3d89d4b4ba29a7ae828d482df5fd0c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page