Python script that lets you easily convert text to synthesized audio files, with help of Amazon's IVONA.
Project description
Python script that lets you easily convert passed text to synthesized audio files, with help of Amazon’s IVONA. All you need is a pair of keys and this script. Yes, that’s literally everything you need to never speak again. If that’s your thing of course.
If you want to use IVONA Speech Cloud directly inside your Python project then have a look at python-ivona-api, which this script also uses.
Installation
>From PyPI (recommended):
$ pip install ivona_speak
With git clone:
$ git clone https://github.com/Pythonity/ivona-speak $ pip install -r ivona-speak/requirements.txt $ cd ivona-speak/bin
Usage
The script comes with two subcommands (synthesize is the default one):
$ ivona-speak synthesize -h Usage: ivona-speak synthesize [OPTIONS] TEXT Synthesize passed text and save it as an audio file Options: --access-key TEXT IVONA Speech Cloud access key. --secret-key TEXT IVONA Speech Cloud secret key. -a, --auth-file FILENAME Path to YAML file with 'access-key' and 'secret- key' set. -o, --output-file PATH Output audio file path. [required] -n, --voice-name TEXT Voice name (default: Salli). -l, --voice-language TEXT Voice language (default: en-US). -c, --codec [ogg|mp3|mp4] Used codec (default: mp3). -h, --help Show this message and exit.
$ ivona-speak list-voices -h Usage: ivona-speak list-voices [OPTIONS] List available Ivona voices Options: --access-key TEXT IVONA Speech Cloud access key. --secret-key TEXT IVONA Speech Cloud secret key. -a, --auth-file FILENAME Path to YAML file with 'access-key' and 'secret- key' set. -l, --voice-language TEXT Filter voice by language. -h, --help Show this message and exit.
Examples
With above usage everything should be pretty clear, but in case it isn’t:
You can provide keys either explicitly or put them in YAML file (one of those ways is required):
$ ivona-speak list-voices --access-key 'YOUR_ACTUAL_ACCESS_KEY' --secret-key 'YOUR_ACTUAL_SECRET_KEY' $ ivona-speak list-voices -a secrets.yaml
Also, synthesize is the default subcommand so those do the same:
$ ivona-speak synthesize -a secrets.yaml -o hello_world.mp3 'Hello world!' $ ivona-speak -a secrets.yaml -o hello_world.mp3 'Hello world!'
List all available IVONA voices, and list them now:
$ ivona-speak list-voices -a secrets.yaml
I want someone to say ‘Hello world!’, and say it quick:
$ ivona-speak synthesize -a secrets.yaml -o hello_world.mp3 'Hello world!'
She sounds so nice. I want someone special to respond her:
$ ivona-speak synthesize -a secrets.yaml -o response.mp3 -n Joey 'How you doin?'
Example auth file
$ cat secrets.yaml access-key: YOUR_ACTUAL_ACCESS_KEY secret-key: YOUR_ACTUAL_SECRET_KEY
Tests
Package was tested with the help of py.test and tox on Python 2.7, 3.4 and 3.5 (see tox.ini).
To run tests yourself you need to set environment variables with secret and access keys before running tox:
$ export IVONA_ACCESS_KEY="YOUR_ACTUAL_ACCESS_KEY"
$ export IVONA_SECRET_KEY="YOUR_ACTUAL_SECRET_KEY"
$ tox
Contributions
Package source code is available at GitHub.
Feel free to use, ask, fork, star, report bugs, fix them, suggest enhancements, add functionality and point out any mistakes.
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
Built Distribution
File details
Details for the file ivona_speak-0.1.2.tar.gz
.
File metadata
- Download URL: ivona_speak-0.1.2.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c54352360fd56d10484281eebf6fd8da7dfb18b8c7c29f2f78048a4b48584d72 |
|
MD5 | b1b80bc9f93625f0564dbda02e638dc6 |
|
BLAKE2b-256 | c61e82ede20357b0f8b5cec6203884fd4fb14a376b32595dd4640ddcf4c33306 |
File details
Details for the file ivona_speak-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: ivona_speak-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e746ac7e1f0ffa3b2fa0b9bd0b7749b0395f4919e4253dc2cb54b92058ba33d |
|
MD5 | ae110db0dfb77877fde5a01be41d2613 |
|
BLAKE2b-256 | 057a0d3c91ddb4ef5281f0b7f35f215408dc084451e0b8f1737f7ea6f31e452c |