Python 3 interface to Microsoft Cognitive Services Text To Speech
Project description
pycsspeechtts
Python (py) library to use Microsofts Cognitive Services Speech (csspeech) Text to Speech (tts) API. The cryptic name is the combination of the abbrevations shown above.
Usage:
from pycsspeechtts import TTSTranslator
t = TTSTranslator("YOUR API KEY","westeurope")
data = t.speak(text='The default voice is using Microsoft Neural Voice. When using a neural voice, synthesized speech is nearly indistinguishable from the human recordings.')
with open("file1.wav", "wb") as f:
f.write(data)
data = t.speak('en-gb','Male','I am Max', 'George, Apollo', 'riff-16khz-16bit-mono-pcm', text='I am Max')
with open("file2.wav", "wb") as f:
f.write(data)
You can also use custom voice by specifying isCustom=True
and providing a customEndpoint
:
from pycsspeechtts import TTSTranslator
t = TTSTranslator("YOUR API KEY","westeurope", isCustom=True, customEndpoint=MyEndpoint)
data = t.speak(language='en-gb',gender='Male',voiceType="ArchieNeural",text="This is a test for custom voice")
See test.py for more samples. Refer to https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support to find the valid values for language, gender, voicetype and output formats.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pycsspeechtts-1.0.8.tar.gz
.
File metadata
- Download URL: pycsspeechtts-1.0.8.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920a1fd13db655153dea92805ae101a39e85eadee8d97ff1452fcbe41ed46036 |
|
MD5 | 0d50e5b85bffafbd2cfef24104430b37 |
|
BLAKE2b-256 | e9817821aeda210239a9a490e587c9f4f0488f8cb723b46b822268e19b0e822f |
File details
Details for the file pycsspeechtts-1.0.8-py3-none-any.whl
.
File metadata
- Download URL: pycsspeechtts-1.0.8-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce78477905f59b663b284f5d368d03e0aa3d8d2053eeb13ce5ad812affd52100 |
|
MD5 | 5bccf82dfbf7036120de8122f84d59ae |
|
BLAKE2b-256 | ada955fb1fdcd35fa020616d056abe51db4544a35f72713c703fbf5d058074e5 |