# 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:
```bash
pip install speech-engine
```
## Usage
### TTS_GOOGLE
```python
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
```python
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
```python
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](https://github.com/PraaneshSelvaraj/speech_engine/blob/main/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.
Raw data
{
"_id": null,
"home_page": "https://github.com/PraaneshSelvaraj/speech_engine",
"name": "speech-engine",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "speech_engine,text2speech,text-to-speech,TTS,speech synthesis,audio generation,natural language processing,language processing,voice synthesis,speech output,speech generation,language synthesis,voice output,audio synthesis,voice generation",
"author": "Praanesh",
"author_email": "praaneshselvaraj2003@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/78/55/d8f93dd5d7f34824cd3a765b4a1706a37152476e0dbf9bc0669ff0d6be55/speech_engine-0.1.0.tar.gz",
"platform": null,
"description": "# Speech Engine\n\nSpeech 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).\n\n## Installation\n\nYou can install `speech-engine` using pip:\n\n```bash\npip install speech-engine\n```\n\n## Usage\n### TTS_GOOGLE\n```python\nfrom speech_engine import TTS_Google, FileExtensionError\n\n# Instantiate TTS_Google\ntts = TTS_Google()\n\n# Set the language and other options\ntts.set_language('en')\ntts.set_slow(False)\n\n# Synthesize and play speech\ntts.speak(\"Hello, world!\")\n\n# Synthesize and save speech as an audio file\ntry:\n tts.save(\"Hello, world!\", \"output.mp3\")\nexcept FileExtensionError as e:\n print(e.message)\n```\n\n### TTS_Witai\n```python\nfrom speech_engine import TTS_Witai\n\n# Instantiate TTS_Witai with the Wit.ai auth token\ntts = TTS_Witai(your_authtoken)\n\n# Set the voice\ntts.set_voice('Colin')\n\n# Synthesize and play speech\ntts.speak(\"Hello, world!\")\n\n# Synthesize and save speech as an audio file\ntts.save(\"Hello, world!\", \"output.mp3\")\n\n\n# Get available voices\nvoices = tts.get_voices()\nprint(voices)\n```\n\n### TTS_Openai\n```python\nfrom speech_engine import TTS_Openai\n\n# Instantiate TTS_Openai with the Openai Api key\ntts = TTS_Openai(your_apikey)\n\n# Set the voice\ntts.set_voice('alloy')\n\n# Synthesize and play speech\ntts.speak(\"Hello, world!\")\n\n# Synthesize and save speech as an audio file\ntts.save(\"Hello, world!\", \"output.mp3\")\n\n\n# Get available voices\nvoices = tts.get_voices()\nprint(voices)\n```\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/PraaneshSelvaraj/speech_engine/blob/main/LICENSE) file for details.\n\n## Contributions\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub.\n",
"bugtrack_url": null,
"license": "",
"summary": "Python package for synthesizing text into speech",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/PraaneshSelvaraj/speech_engine"
},
"split_keywords": [
"speech_engine",
"text2speech",
"text-to-speech",
"tts",
"speech synthesis",
"audio generation",
"natural language processing",
"language processing",
"voice synthesis",
"speech output",
"speech generation",
"language synthesis",
"voice output",
"audio synthesis",
"voice generation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e3954fc18a9103e76b424985fe5c27f9e266486c2267b1aa44a25641f24724bd",
"md5": "69f0c0bd404799897473f9f9f771914b",
"sha256": "9ab8fbaafa87d53714bead5f224068e5b7da7989aaccc16dceddc137fa3fbebf"
},
"downloads": -1,
"filename": "speech_engine-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "69f0c0bd404799897473f9f9f771914b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6648,
"upload_time": "2024-03-18T01:57:12",
"upload_time_iso_8601": "2024-03-18T01:57:12.708105Z",
"url": "https://files.pythonhosted.org/packages/e3/95/4fc18a9103e76b424985fe5c27f9e266486c2267b1aa44a25641f24724bd/speech_engine-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7855d8f93dd5d7f34824cd3a765b4a1706a37152476e0dbf9bc0669ff0d6be55",
"md5": "2a95a95e77ea3fd812dd0a5f969bd266",
"sha256": "57e13a3cc07b9ceab58ee506b6192d826137b4ea357665668d45d1c01bb119e9"
},
"downloads": -1,
"filename": "speech_engine-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "2a95a95e77ea3fd812dd0a5f969bd266",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5057,
"upload_time": "2024-03-18T01:57:13",
"upload_time_iso_8601": "2024-03-18T01:57:13.825361Z",
"url": "https://files.pythonhosted.org/packages/78/55/d8f93dd5d7f34824cd3a765b4a1706a37152476e0dbf9bc0669ff0d6be55/speech_engine-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-18 01:57:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PraaneshSelvaraj",
"github_project": "speech_engine",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "speech-engine"
}