Skip to main content

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

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.

Author

Guenter Bartsch <<guenter@zamia.org>>

Release files for py-marytts 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-marytts 0.1.4
File Size Uploaded
py-marytts-0.1.4.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-marytts 0.1.4
File Interpreter ABI Platform
py_marytts-0.1.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 10.1 kB

Release files / py-marytts-0.1.4.tar.gz

Download URL py-marytts-0.1.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
17a5211b38b0005747c1cab69190604a80a359ce7f779de915594b2816991ec8
BLAKE2b-256 checksum
How to use checksums
cd3f0ea997336367ea204b2e48cb6bc5cd60c602c3f93e422cc4cee5e8ee10b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / py_marytts-0.1.4-py2.py3-none-any.whl

Download URL py_marytts-0.1.4-py2.py3-none-any.whl
Size 6.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
dbe058d38acb4751b3a25c8ab8940723ae3fd8ac82f9a6ee3cf0f906338d2258
BLAKE2b-256 checksum
How to use checksums
6a97b01d0eaf74b18cce1cbf67f9b1939d7f248e20486563eab37e4128edfee4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page