macOS tts. 'say' python interface
Project description
Installation
$ [sudo] pip install mac-say
Functions
function | __doc__ |
---|---|
mac_say.say(args, background=False) |
run say with given args |
mac_say.voices(lang=None) |
return a list of installed voices (name, lang, description) |
mac_say.gtts.mp3(lang, string) |
create .mp3 file (if cache not exists) and return path |
mac_say.gtts.say(lang, string) |
creare .mp3 file and play it with afplay |
CLI
usage | __doc__ |
---|---|
python -m mac_say.gtts lang strings ... |
create . mp3 file with Google Text-to-Speech and play it with afplay |
Examples
>>> import mac_say
>>> mac_say.say("hello world")
>>> mac_say.say(["-f","file.txt","-v","Alex"])
voices list
>>> mac_say.voices("en")
[('Alex', 'en_US', 'Most people recognize me by my voice.'), ...]
background - add background=True
>>> mac_say.say("hello world",background=True)
Google Text-To-Speech
>>> mac_say.gtts.mp3("en","hello world")
/Users/username/Library/Caches/say/<hash>.mp3
>>> mac_say.gtts.say("en","hello world")
$ python -m mac_say.gtts "en" "hello world"
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
mac-say-2019.3.22.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for mac_say-2019.3.22-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6820444013c37a4223e7f672831785b37d876ed8501ae15b1abc5e5c46fd9a8 |
|
MD5 | 372d7c1969b13d03e7fd9130f33d5c2c |
|
BLAKE2b-256 | cebc3f94cf23f3d193f4558cfe7c1956f22d265b428b647823a30d00f1d03918 |