A simple text-to-speech client using azure TTS API(trial).
Project description
:speaking_head: aspeak
A simple text-to-speech client using azure TTS API(trial). :laughing:
TL;DR: This program uses trial auth token of Azure Cognitive Services to do speech synthesis for you.
You can try the Azure TTS API online: https://azure.microsoft.com/en-us/services/cognitive-services/text-to-speech
Installation
$ pip install aspeak
Usage
usage: aspeak [-h] [-v] [-t [TEXT] | -s [SSML]] [-f FILE] [-o OUTPUT_PATH] [-l LOCALE]
This program uses trial auth token of Azure Cognitive Services to do speech synthesis for you.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-t [TEXT], --text [TEXT]
Text to speak. Left blank when reading from file/stdin.
-s [SSML], --ssml [SSML]
SSML to speak. Left blank when reading from file/stdin.
-f FILE, --file FILE Text/SSML file to speak, default to `-`(stdin).
-o OUTPUT_PATH, --output OUTPUT_PATH
Output wav file path
-l LOCALE, --locale LOCALE
Locale to use, default to en-US
- If you don't specify
-o
, we will use your default speaker. - If you don't specify
-t
or-s
, we will assume-t
is provided.
Examples
Speak "Hello, world!" to default speaker.
$ aspeak -t "Hello, world!" -o output.wav
Save synthesized speech to a file.
$ aspeak -t "Hello, world!" -o output.wav
Read text from file and speak it.
$ cat input.txt | aspeak
or
$ aspeak -f input.txt
Read from stdin and speak it.
$ aspeak
or (more verbose)
$ aspeak -f -
Speak Chinese.
$ aspeak -t "你好,世界!" -l zh-CN
About This Application
- I found Azure TTS can synthesize nearly authentic human voice, which is very interesting :laughing:.
- I wrote this program to learn Azure Cognitive Services.
- And I use this program daily, because
espeak
andfestival
outputs terrible :fearful: audio.- But I respect :raised_hands: their maintainers' work, both are good open source software and they can be used off-line.
- I hope you like it :heart:.
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
aspeak-0.2.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
aspeak-0.2.1-py3-none-any.whl
(7.2 kB
view hashes)