Giter Site home page Giter Site logo

praaneshselvaraj / speech_engine Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 13 KB

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).

Home Page: https://pypi.org/project/speech-engine/

License: MIT License

Python 100.00%
speechsynthesis text-to-speech text2speech hacktoberfest-accepted hactoberfest

speech_engine's Introduction

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.mp3")


# 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)

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.

speech_engine's People

Contributors

praaneshselvaraj avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.