Skip to main content

not official API for Microsoft speech synthesis from Microsoft Edge web browser read aloud

Project description

msspeech

not official API for Microsoft speech synthesis from Microsoft Edge web browser read aloud

Installation

poetry install msspeech

or

pip install --upgrade msspeech

or

pip install --upgrade https://github.com/alekssamos/msspeech/archive/refs/heads/main.zip

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.

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

Using

Example

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(1)
	await mss.set_pitch(0)
	await mss.set_volume(2)
	await mss.synthesize(text.strip(), filename)
	print("*"*10)
	print("SUCCESS! OK!")
	print("*"*10)

if __name__ == "__main__":
	loop = asyncio.get_event_loop()
	loop.run_until_complete(main())

The maximum text length is approximately 31,000 characters.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msspeech-3.7.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

msspeech-3.7.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file msspeech-3.7.1.tar.gz.

File metadata

  • Download URL: msspeech-3.7.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.7 Windows/10

File hashes

Hashes for msspeech-3.7.1.tar.gz
Algorithm Hash digest
SHA256 b44ac3c8198671ba2a77be6799696402fc0d85d4f28a8aee328821d1c0437554
MD5 598e9a746b6a96dca93559da1fdf1b4e
BLAKE2b-256 2b75286bb050af03a9bf0ceb2ac0f15f26e77c82022494d63177e90ed6b3eb13

See more details on using hashes here.

Provenance

File details

Details for the file msspeech-3.7.1-py3-none-any.whl.

File metadata

  • Download URL: msspeech-3.7.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.7 Windows/10

File hashes

Hashes for msspeech-3.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16ade0fc9e1243dc8a49ebfe4c97583f887b8b63d9a4c3a204f382fd110b9ce7
MD5 0ffaf755831e8951e39a938e9172bb96
BLAKE2b-256 be3cc2c07144068a305d09cdb601bf9e5bbd134489b3ecf7061bde61a7ef357e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page