Python interface for Mary TTS
Project description
A pretty simple HTTP based interface to MaryTTS intended to make using this excellent TTS for waveform and IPA generation as convenient as possible.
Target audience are developers who would like to use MaryTTS as-is for speech synthesis in their Python application on GNU/Linux operating systems.
Constructive comments, patches and pull-requests are very welcome.
Examples
First, imports:
import wave import StringIO from marytts import MaryTTS
english (default) synthesis:
marytts = MaryTTS() wavs = marytts.synth_wav(‘Hello World!’) wav = wave.open(StringIO.StringIO(wavs)) print wav.getnchannels(), wav.getframerate(), wav.getnframes()
result:
1 16000 21520
try a different language:
marytts.locale = ‘de’ marytts.voice = ‘bits3’ wavs = marytts.synth_wav(‘Hallo Welt!’) wav = wave.open(StringIO.StringIO(wavs)) print wav.getnchannels(), wav.getframerate(), wav.getnframes()
result:
1 16000 16760
### List Available Voices
l = marytts.voices
result:
>>> l[0] ['upmc-pierre-hsmm', 'fr', 'male', 'hmm'] >>> l[1] ['dfki-pavoque-neutral-hsmm', 'de', 'male', 'hmm'] >>> l[2] ['cmu-slt-hsmm', 'en_US', 'female', 'hmm'] >>> l[3] ['cmu-rms-hsmm', 'en_US', 'male', 'hmm'] ...
### Grapheme to Phoneme (G2P) Conversion
marytts.locale = ‘en_US’ marytts.voice = ‘cmu-rms-hsmm’ cs = marytts.g2p (‘Hello World!’)
result:
>>> cs "h @ - ' l @U ' w r= l d"
### Synthesize Phonemes
wavs = marytts.synth_wav(“h @ - ‘ l @U ‘ w r= l d”, fmt=’xs’) wav = wave.open(StringIO.StringIO(wavs)) print wav.getnchannels(), wav.getframerate(), wav.getnframes()
result:
1 16000 21520
Links
<https://github.com/marytts/marytts> [MaryTTS on github]
Requirements
Python 2.7
MaryTTS server running
License
My own code is Apache-2.0 licensed unless otherwise noted in the script’s copyright headers.
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 py-marytts-0.1.4.tar.gz
.
File metadata
- Download URL: py-marytts-0.1.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a5211b38b0005747c1cab69190604a80a359ce7f779de915594b2816991ec8 |
|
MD5 | 4a1c385849cc23558e4362e2333bba2a |
|
BLAKE2b-256 | cd3f0ea997336367ea204b2e48cb6bc5cd60c602c3f93e422cc4cee5e8ee10b8 |
File details
Details for the file py_marytts-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: py_marytts-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe058d38acb4751b3a25c8ab8940723ae3fd8ac82f9a6ee3cf0f906338d2258 |
|
MD5 | d507ce6881f03f1aae4b995b1e995a7d |
|
BLAKE2b-256 | 6a97b01d0eaf74b18cce1cbf67f9b1939d7f248e20486563eab37e4128edfee4 |