msspeech


Namemsspeech JSON
Version 3.7.12 PyPI version JSON
download
home_pagehttps://github.com/alekssamos/msspeech
Summarynot official API for Microsoft speech synthesis from Microsoft Edge web browser read aloud
upload_time2023-08-20 14:43:30
maintainer
docs_urlNone
authorAlexey
requires_python>=3.7,<3.12
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # msspeech
not official API for Microsoft speech synthesis from Microsoft Edge web browser read aloud

## Installation

`pip install --upgrade msspeech`

or

`poetry add msspeech`


After updating an already installed library
To update the list of voices, run the command in your terminal:

`msspeech-update-voices`

or

`poetry run msspeech-update-voices`


## Notes
### Bad news

Since the first of July 2022,
the list of voices and the API as a whole has been very much limited!

### But there is also good news

They returned back some male voices and added new languages, as well as made support for emotional styles.
Despite the fact that styles appeared in JSON, you still won't be able to use them, SSML does not perceive them.
SSML is very limited here, so there is no point in supporting it.

The official documentation is not suitable for this API. It seems this API uses **undocumented** SSML markup.

https://docs.microsoft.com/ru-ru/azure/cognitive-services/speech-service/language-support#text-to-speech

## Using
the pitch and rate values are set as a percentage from -100 to +100,
that is, it can be a negative, positive number, or zero for the default value.

examples: -30, 40, 0


The volume should be a fractional number from 0.1 to 1.0, but in fact it doesn't work for some reason.


The maximum synthesize text length is approximately 31000 characters per request.

### from CLI

synthesize text:

`msspeech Guy hello --filename audio.mp3`

update voices list:

`msspeech-update-voices`

### From python
```python
import asyncio
from msspeech import MSSpeech


async def main():
	mss = MSSpeech()
	print("Geting voices...")
	voices = await mss.get_voices_list()
	print("searching Russian voice...")
	for voice in voices:
		if voice["Locale"] == "ru-RU":
			print("Russian voice found:", voice["FriendlyName"])
			await mss.set_voice(voice["Name"])


	print("*" * 10)
	filename = "audio.mp3"
	# with open("s.txt", encoding="UTF8") as f: text:str = f.read()
	text = "Или написать текст здесь"
	print("waiting...")
	await mss.set_rate(10)
	await mss.set_pitch(0)
	await mss.set_volume(1.0)
	await mss.synthesize(text.strip(), filename)
	print("*"*10)
	print("SUCCESS! OK!")
	print("*"*10)

if __name__ == "__main__":
	asyncio.run(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alekssamos/msspeech",
    "name": "msspeech",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<3.12",
    "maintainer_email": "",
    "keywords": "",
    "author": "Alexey",
    "author_email": "aleks-samos@yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/f2/d9/a4609e5d5d1ce71aa5d39b083fb36e6ad34e77a125e56264fd7de33a3337/msspeech-3.7.12.tar.gz",
    "platform": null,
    "description": "# msspeech\nnot official API for Microsoft speech synthesis from Microsoft Edge web browser read aloud\n\n## Installation\n\n`pip install --upgrade msspeech`\n\nor\n\n`poetry add msspeech`\n\n\nAfter updating an already installed library\nTo update the list of voices, run the command in your terminal:\n\n`msspeech-update-voices`\n\nor\n\n`poetry run msspeech-update-voices`\n\n\n## Notes\n### Bad news\n\nSince the first of July 2022,\nthe list of voices and the API as a whole has been very much limited!\n\n### But there is also good news\n\nThey returned back some male voices and added new languages, as well as made support for emotional styles.\nDespite the fact that styles appeared in JSON, you still won't be able to use them, SSML does not perceive them.\nSSML is very limited here, so there is no point in supporting it.\n\nThe official documentation is not suitable for this API. It seems this API uses **undocumented** SSML markup.\n\nhttps://docs.microsoft.com/ru-ru/azure/cognitive-services/speech-service/language-support#text-to-speech\n\n## Using\nthe pitch and rate values are set as a percentage from -100 to +100,\nthat is, it can be a negative, positive number, or zero for the default value.\n\nexamples: -30, 40, 0\n\n\nThe volume should be a fractional number from 0.1 to 1.0, but in fact it doesn't work for some reason.\n\n\nThe maximum synthesize text length is approximately 31000 characters per request.\n\n### from CLI\n\nsynthesize text:\n\n`msspeech Guy hello --filename audio.mp3`\n\nupdate voices list:\n\n`msspeech-update-voices`\n\n### From python\n```python\nimport asyncio\nfrom msspeech import MSSpeech\n\n\nasync def main():\n\tmss = MSSpeech()\n\tprint(\"Geting voices...\")\n\tvoices = await mss.get_voices_list()\n\tprint(\"searching Russian voice...\")\n\tfor voice in voices:\n\t\tif voice[\"Locale\"] == \"ru-RU\":\n\t\t\tprint(\"Russian voice found:\", voice[\"FriendlyName\"])\n\t\t\tawait mss.set_voice(voice[\"Name\"])\n\n\n\tprint(\"*\" * 10)\n\tfilename = \"audio.mp3\"\n\t# with open(\"s.txt\", encoding=\"UTF8\") as f: text:str = f.read()\n\ttext = \"\u0418\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0437\u0434\u0435\u0441\u044c\"\n\tprint(\"waiting...\")\n\tawait mss.set_rate(10)\n\tawait mss.set_pitch(0)\n\tawait mss.set_volume(1.0)\n\tawait mss.synthesize(text.strip(), filename)\n\tprint(\"*\"*10)\n\tprint(\"SUCCESS! OK!\")\n\tprint(\"*\"*10)\n\nif __name__ == \"__main__\":\n\tasyncio.run(main())\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "not official API for Microsoft speech synthesis from Microsoft Edge web browser read aloud",
    "version": "3.7.12",
    "project_urls": {
        "Bug Tracker": "https://github.com/alekssamos/msspeech/issues",
        "Homepage": "https://github.com/alekssamos/msspeech",
        "Repository": "https://github.com/alekssamos/msspeech"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f76a6ab7d4b858f31237b1c265fd49486484f1bf4be986b9c113d4e425ca1c66",
                "md5": "ccfd508b10fae89cac32b951a52db6f2",
                "sha256": "b325e981ebc15f6ac9ce2eb3d330c6b0d8f3bfd18066b8979bd998148c8169c2"
            },
            "downloads": -1,
            "filename": "msspeech-3.7.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ccfd508b10fae89cac32b951a52db6f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<3.12",
            "size": 17718,
            "upload_time": "2023-08-20T14:43:28",
            "upload_time_iso_8601": "2023-08-20T14:43:28.649788Z",
            "url": "https://files.pythonhosted.org/packages/f7/6a/6ab7d4b858f31237b1c265fd49486484f1bf4be986b9c113d4e425ca1c66/msspeech-3.7.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2d9a4609e5d5d1ce71aa5d39b083fb36e6ad34e77a125e56264fd7de33a3337",
                "md5": "52530752f457ce7ab29f576edf5696a5",
                "sha256": "7d8795a8891b97b4ace40cc45297c7498ecad210b28a232427e30ee41f1e5c9d"
            },
            "downloads": -1,
            "filename": "msspeech-3.7.12.tar.gz",
            "has_sig": false,
            "md5_digest": "52530752f457ce7ab29f576edf5696a5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<3.12",
            "size": 17986,
            "upload_time": "2023-08-20T14:43:30",
            "upload_time_iso_8601": "2023-08-20T14:43:30.337837Z",
            "url": "https://files.pythonhosted.org/packages/f2/d9/a4609e5d5d1ce71aa5d39b083fb36e6ad34e77a125e56264fd7de33a3337/msspeech-3.7.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-20 14:43:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alekssamos",
    "github_project": "msspeech",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "msspeech"
}
        
Elapsed time: 0.09973s