*****************************************************
pyttsx3 (offline TTS for Python 3)
*****************************************************
``pyttsx3`` is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and 3.
Installation
************
::
pip install pyttsx3
If you recieve errors such as ``No module named win32com.client``, ``No module named win32``, or ``No module named win32api``, you will need to additionally install ``pypiwin32``.
Usage :
************
::
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
**Changing Voice , Rate and Volume :**
::
import pyttsx3
engine = pyttsx3.init() # object creation
""" RATE"""
rate = engine.getProperty('rate') # getting details of current speaking rate
print (rate) #printing current voice rate
engine.setProperty('rate', 125) # setting up new voice rate
"""VOLUME"""
volume = engine.getProperty('volume') #getting to know current volume level (min=0 and max=1)
print (volume) #printing current volume level
engine.setProperty('volume',1.0) # setting up volume level between 0 and 1
"""VOICE"""
voices = engine.getProperty('voices') #getting details of current voice
#engine.setProperty('voice', voices[0].id) #changing index, changes voices. o for male
engine.setProperty('voice', voices[1].id) #changing index, changes voices. 1 for female
engine.say("Hello World!")
engine.say('My current speaking rate is ' + str(rate))
engine.runAndWait()
engine.stop()
"""Saving Voice to a file"""
# On linux make sure that 'espeak' and 'ffmpeg' are installed
engine.save_to_file('Hello World', 'test.mp3')
engine.runAndWait()
**Full documentation of the Library**
#####################################
https://pyttsx3.readthedocs.io/en/latest/
Included TTS engines:
*********************
* sapi5
* nsss
* espeak
Feel free to wrap another text-to-speech engine for use with ``pyttsx3``.
Project Links:
**************
* PyPI (https://pypi.python.org)
* GitHub (https://github.com/nateshmbhat/pyttsx3)
* Full Documentation (https://pyttsx3.readthedocs.org)
Raw data
{
"_id": null,
"home_page": "https://github.com/nateshmbhat/pyttsx3",
"name": "pyttsx3",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pyttsx,ivona,pyttsx for python3,TTS for python3,pyttsx3,text to speech for python,tts,text to speech,speech,speech synthesis,offline text to speech,offline tts,gtts",
"author": "Natesh M Bhat",
"author_email": "nateshmbhatofficial@gmail.com",
"download_url": "",
"platform": "",
"description": "*****************************************************\npyttsx3 (offline TTS for Python 3)\n*****************************************************\n\n``pyttsx3`` is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and 3.\n\nInstallation\n************\n::\n\n\tpip install pyttsx3\n\n\nIf you recieve errors such as ``No module named win32com.client``, ``No module named win32``, or ``No module named win32api``, you will need to additionally install ``pypiwin32``.\n\n\nUsage :\n************\n::\n\n\timport pyttsx3\n\tengine = pyttsx3.init()\n\tengine.say(\"I will speak this text\")\n\tengine.runAndWait()\n\n\n**Changing Voice , Rate and Volume :**\n\n::\n\n\timport pyttsx3\n\tengine = pyttsx3.init() # object creation\n\n\t\"\"\" RATE\"\"\"\n\trate = engine.getProperty('rate') # getting details of current speaking rate\n\tprint (rate) #printing current voice rate\n\tengine.setProperty('rate', 125) # setting up new voice rate\n\n\n\t\"\"\"VOLUME\"\"\"\n\tvolume = engine.getProperty('volume') #getting to know current volume level (min=0 and max=1)\n\tprint (volume) #printing current volume level\n\tengine.setProperty('volume',1.0) # setting up volume level between 0 and 1\n\n\t\"\"\"VOICE\"\"\"\n\tvoices = engine.getProperty('voices') #getting details of current voice\n\t#engine.setProperty('voice', voices[0].id) #changing index, changes voices. o for male\n\tengine.setProperty('voice', voices[1].id) #changing index, changes voices. 1 for female\n\n\tengine.say(\"Hello World!\")\n\tengine.say('My current speaking rate is ' + str(rate))\n\tengine.runAndWait()\n\tengine.stop()\n\n\t\"\"\"Saving Voice to a file\"\"\"\n\t# On linux make sure that 'espeak' and 'ffmpeg' are installed\n\tengine.save_to_file('Hello World', 'test.mp3')\n\tengine.runAndWait()\n\n\n**Full documentation of the Library**\n#####################################\n\nhttps://pyttsx3.readthedocs.io/en/latest/\n\n\nIncluded TTS engines:\n*********************\n* sapi5\n* nsss\n* espeak\n\nFeel free to wrap another text-to-speech engine for use with ``pyttsx3``.\n\nProject Links:\n**************\n\n* PyPI (https://pypi.python.org)\n* GitHub (https://github.com/nateshmbhat/pyttsx3)\n* Full Documentation (https://pyttsx3.readthedocs.org)\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Text to Speech (TTS) library for Python 2 and 3. Works without internet connection or delay. Supports multiple TTS engines, including Sapi5, nsss, and espeak.",
"version": "2.90",
"split_keywords": [
"pyttsx",
"ivona",
"pyttsx for python3",
"tts for python3",
"pyttsx3",
"text to speech for python",
"tts",
"text to speech",
"speech",
"speech synthesis",
"offline text to speech",
"offline tts",
"gtts"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "43ce353b05a353f3b858d78423147123",
"sha256": "a585b6d8cffc19bd92db1e0ccbd8aa9c6528dd2baa5a47045d6fed542a44aa19"
},
"downloads": -1,
"filename": "pyttsx3-2.90-py3-none-any.whl",
"has_sig": false,
"md5_digest": "43ce353b05a353f3b858d78423147123",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 39530,
"upload_time": "2020-07-06T17:47:13",
"upload_time_iso_8601": "2020-07-06T17:47:13.578301Z",
"url": "https://files.pythonhosted.org/packages/33/9a/de4781245f5ad966646fd276259ef7cfd400ba3cf7d5db7c0d5aab310c20/pyttsx3-2.90-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-07-06 17:47:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "nateshmbhat",
"github_project": "pyttsx3",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pyttsx3"
}