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.
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
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())
Metadata
Release files for msspeech 3.7.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| msspeech-3.7.12.tar.gz | 18.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| msspeech-3.7.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.7 kB
Release files / msspeech-3.7.12.tar.gz
| Download URL | msspeech-3.7.12.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d8795a8891b97b4ace40cc45297c7498ecad210b28a232427e30ee41f1e5c9d
|
|
BLAKE2b-256 checksum How to use checksums |
f2d9a4609e5d5d1ce71aa5d39b083fb36e6ad34e77a125e56264fd7de33a3337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1041-azure
|
Release files / msspeech-3.7.12-py3-none-any.whl
| Download URL | msspeech-3.7.12-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b325e981ebc15f6ac9ce2eb3d330c6b0d8f3bfd18066b8979bd998148c8169c2
|
|
BLAKE2b-256 checksum How to use checksums |
f76a6ab7d4b858f31237b1c265fd49486484f1bf4be986b9c113d4e425ca1c66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1041-azure
|
Security for msspeech 3.7.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.