{ "info": { "author": "Jeff Greenberg", "author_email": "jeff@ziligy.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Home Automation", "Topic :: Multimedia :: Sound/Audio :: Speech" ], "description": "# watson-text-talker\n\n### About\nI created this interface for a voice-based-bot that I'm running on a Raspberry Pi 3B. I'm using the AIY Voice HAT, but I was very displeased with the robotic-voice that's supplied by Google. After studying a few other voice options I decided on IBM's Watson because of it's high quality cadence and intonation. I added some features for my purposes and decided others may find some benefit in my effort. The package should work in other internet-connected & sound-output-capable devices.\n\n### Installation\n\n pip3 install watson-text-talker --user\n\n### Get [IBM credentials](https://console.bluemix.net/catalog/services/text-to-speech) for Watson Text-To-Speech, Lite Plan is *FREE*\n\n### Simple Use\n\n```python\nfrom watson_text_talker import *\n\ntext_talker = TextTalker(username='your-watson-tts-credentials-username', password='your-watson-tts-credentials-password')\n\ntext_talker.say(\"Hello world!\")\n```\n\n### Features\n\n* #### Voice file cacheing\n - lowers cloud round-trips\n - keeps cost down\n* #### Phrase grouping\n - segments phrases/sentences\n - each segment can have it's own importance factor\n* #### Importance factors\n - optional percentage chance that a phrase will be voiced\n* #### Quiet level\n - optional quiet level factor can be applied to all optional phrases\n - increases or decreases the likelihood that an optional phrase will be voiced\n* #### Uses high-quality Waston voices\n - very realistic sounding, with appropriate cadence and intonation\n - voice selection: [see here for selection available](https://www.ibm.com/watson/developercloud/text-to-speech/api/v1/curl.html?curl#get-voice)\n - free tier plan: no credit card required, 10,000 characters per month at no cost\n\n### Voice file cacheing\nThe package *always* caches new phrases to a file. The cache directory defaults to `./voice_mp3s`, but can also be defined in TT_Config. To regulate the filename I slugify the phrase. This has the advantage of making it human readable. The only caveat is the phrase MUST be limited to 255 characters.\n\n### Phrase grouping\nPhrase grouping is based on array of tuples.\n\n```python\n from watson_text_talker import *\n\n text_talker = TextTalker(username='credentials-username', password='credentials-password')\n\n importance = TT_Importance()\n\n grouping_example = [(importance.SAY_30_PERCENT, \"I'm your assistant.\"), (importance.SAY_50_PERCENT, \"How are you?\"), (importance.SAY_ALWAYS, \"Nice to meet you\") ]\n\n text_talker.say_group(grouping_example)\n```\n\nTuples are made up of the importance & the text phrase.\n\n### Importance factors\n```python\n# TT_Importance is a class of numeric constants\n SAY_ALWAYS = 1\n SAY_90_PERCENT = 2\n SAY_80_PERCENT = 3\n SAY_70_PERCENT = 4\n SAY_60_PERCENT = 5\n SAY_50_PERCENT = 6\n SAY_40_PERCENT = 7\n SAY_30_PERCENT = 8\n SAY_20_PERCENT = 9\n SAY_10_PERCENT = 10\n SAY_NEVER = 11\n```\n\nFor the same as above we could have just as easily said:\n```python\n from watson_text_talker import *\n\n text_talker = TextTalker(username='credentials-username', password='credentials-password')\n\n grouping_example = [(8, \"I'm your assistant.\"), (6, \"How are you?\"), (1, \"Nice to meet you\") ]\n\n text_talker.say_group(grouping_example)\n```\n\n### Quiet level\nThe package includes a globally applied `quite level` that increases or decreases the likelihood that an optional phrase will be voiced.\n\n```python\n from watson_text_talker import *\n\n text_talker = TextTalker(username='credentials-username', password='credentials-password')\n\n importance = TT_Importance()\n\n grouping_example = [(importance.SAY_30_PERCENT, \"I'm your assistant.\"), (importance.SAY_ALWAYS, \"Nice to meet you\") ]\n\n text_talker.quiet_level = +2\n\n text_talker.say_group(grouping_example)\n```\n\nIn the above example the `I'm your assistant` phrase will only be said 10% of the time because of the +2 assigned to quiet level. The `Nice to meet you` is not effected.\n\n### Config\nuse the TT_Config class to override configuration defaults\n\n```python\n# TT_Config's standard defaults\n\n USERNAME='--watson tts credentials username goes here--'\n PASSWORD='--watson tts credentials password goes here--'\n\n TTS_VOICE = 'en-US_AllisonVoice'\n TTS_ACCEPT = 'audio/mp3'\n\n CACHE_DIRECTORY = 'voice_mp3s'\n CACHE_DIRECTORY_IS_RELATIVE = True\n VOICE_FILE_EXTENSION = 'mp3'\n```\n\nUse it like so:\n```python\n from watson_text_talker import *\n\n config = TT_Config()\n config.CREDENTIALS_USERNAME='your watson credentials'\n config.CREDENTIALS_PASSWORD='your watson password'\n config.TTS_Voice = 'en-US_MichaelVoice'\n congig.CACHE_DIRECTORY = 'custom_cache'\n\n text_talker = TextTalker(config=config)\n\n text_talker.say(\"Hello world!\")\n```\n\n### Attributions\n\n* [pygame](https://github.com/pygame/pygame) is used to process the mp3 voice files\n* [python-slugify](https://github.com/un33k/python-slugify) is used to create cache file names\n\n\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ziligy/watson-text-talker", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "watson-text-talker", "package_url": "https://pypi.org/project/watson-text-talker/", "platform": "", "project_url": "https://pypi.org/project/watson-text-talker/", "project_urls": { "Homepage": "https://github.com/ziligy/watson-text-talker" }, "release_url": "https://pypi.org/project/watson-text-talker/0.8.10/", "requires_dist": [ "watson-developer-cloud", "pygame", "python-slugify" ], "requires_python": "", "summary": "Simple Text-to-Speech Interface for Raspberry Pi using IBM's Watson TTS", "version": "0.8.10" }, "last_serial": 4138341, "releases": { "0.8.10": [ { "comment_text": "", "digests": { "md5": "efd5681de87e2a2e290c0eaa63b18e8e", "sha256": "fb0eb23c61609f3a249b5697721ef1928f62ba042d9c9dc45cd4576dae85245c" }, "downloads": -1, "filename": "watson_text_talker-0.8.10-py3-none-any.whl", "has_sig": false, "md5_digest": "efd5681de87e2a2e290c0eaa63b18e8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5442, "upload_time": "2018-08-05T20:37:08", "url": "https://files.pythonhosted.org/packages/bf/e7/d8e960daa4cc08f80b33084b5e18f59656db63e25b21fe217dd31c02b95b/watson_text_talker-0.8.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7169048761c2b3d314b922e9fae23c3", "sha256": "cdcd1c531b3e3d6b0380e430120094352e9a5dd0f47b0a6bc9804df86d8a2757" }, "downloads": -1, "filename": "watson_text_talker-0.8.10.tar.gz", "has_sig": false, "md5_digest": "e7169048761c2b3d314b922e9fae23c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4878, "upload_time": "2018-08-05T20:37:09", "url": "https://files.pythonhosted.org/packages/59/3b/3c0ad1c9cdc41a905456aa87e6feeed14021183198aa92a8ba8e625fdedb/watson_text_talker-0.8.10.tar.gz" } ], "0.8.8": [ { "comment_text": "", "digests": { "md5": "fb28f5104089d45b827940ba694274f8", "sha256": "c5990b73397da2771fc28c093f0d5ab39160e559c888c507716381d5cffb24ae" }, "downloads": -1, "filename": "watson_text_talker-0.8.8-py3-none-any.whl", "has_sig": false, "md5_digest": "fb28f5104089d45b827940ba694274f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3339, "upload_time": "2018-08-03T12:05:03", "url": "https://files.pythonhosted.org/packages/cb/e0/1e4b2b0d1aa6e5b0714cc94555d484d9275b734c0b72e9a27723fe219dc4/watson_text_talker-0.8.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee814b89ef699e3175be03988a48c2a4", "sha256": "203cf2e4cba200017a6ecc904463e9a5569b2804706016b3eeb7469bc7b30472" }, "downloads": -1, "filename": "watson_text_talker-0.8.8.tar.gz", "has_sig": false, "md5_digest": "ee814b89ef699e3175be03988a48c2a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2626, "upload_time": "2018-08-03T12:05:04", "url": "https://files.pythonhosted.org/packages/f0/39/599f5266bf534572f666aec897fba8385aabcaaa9d4774b40ec0c06a79b8/watson_text_talker-0.8.8.tar.gz" } ], "0.8.9": [ { "comment_text": "", "digests": { "md5": "66535ddce6d404bce07d228f9995baec", "sha256": "d53fabe77513fda550a598df323e2d30f92c905c8f8673d587b325f9f108b88f" }, "downloads": -1, "filename": "watson_text_talker-0.8.9-py3-none-any.whl", "has_sig": false, "md5_digest": "66535ddce6d404bce07d228f9995baec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3532, "upload_time": "2018-08-03T18:56:03", "url": "https://files.pythonhosted.org/packages/e4/74/5f2d1dfe086eab8c9f3c9498333b776772ee267e9eee202e724cfb214610/watson_text_talker-0.8.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8449419ffb7d59f20d4b5fb55b48583", "sha256": "011d68140a21881fd8d4e47b32ecfdfc116402a22f280b1760894d7824f8c9c1" }, "downloads": -1, "filename": "watson_text_talker-0.8.9.tar.gz", "has_sig": false, "md5_digest": "e8449419ffb7d59f20d4b5fb55b48583", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2847, "upload_time": "2018-08-03T18:56:05", "url": "https://files.pythonhosted.org/packages/8f/da/374317ee9a953fa5affc574eadf07d79bf54e2417477429df974399a5c97/watson_text_talker-0.8.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "efd5681de87e2a2e290c0eaa63b18e8e", "sha256": "fb0eb23c61609f3a249b5697721ef1928f62ba042d9c9dc45cd4576dae85245c" }, "downloads": -1, "filename": "watson_text_talker-0.8.10-py3-none-any.whl", "has_sig": false, "md5_digest": "efd5681de87e2a2e290c0eaa63b18e8e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5442, "upload_time": "2018-08-05T20:37:08", "url": "https://files.pythonhosted.org/packages/bf/e7/d8e960daa4cc08f80b33084b5e18f59656db63e25b21fe217dd31c02b95b/watson_text_talker-0.8.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e7169048761c2b3d314b922e9fae23c3", "sha256": "cdcd1c531b3e3d6b0380e430120094352e9a5dd0f47b0a6bc9804df86d8a2757" }, "downloads": -1, "filename": "watson_text_talker-0.8.10.tar.gz", "has_sig": false, "md5_digest": "e7169048761c2b3d314b922e9fae23c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4878, "upload_time": "2018-08-05T20:37:09", "url": "https://files.pythonhosted.org/packages/59/3b/3c0ad1c9cdc41a905456aa87e6feeed14021183198aa92a8ba8e625fdedb/watson_text_talker-0.8.10.tar.gz" } ] }