pymbrola#

GitHub Actions Workflow Status PyPI - Version PyPI - Python Version GitHub License Codecov

A Python front-end for the MBROLA speech synthesizer. pymbrola enables programmatic creation of MBROLA-compatible .pho files and automated audio synthesis with Python, supporting customizable phonemes, durations, and pitch contours.
 1 import mbrola
 2
 3 # Create an MBROLA object
 4 word = mbrola.MBROLA(
 5     phon=["h", "e", "l", "@U"],
 6     durations=[75, 100, 100, 200],
 7     pitch=[50, 150, 175, 200]
 8 )
 9
10 # Export to PHO file
11 word.export_pho("hello.pho")
12
13 # Synthesize and save audio in WAV file
14 word.make_sound("hello.wav", voice="en1")

Docker image#

For convenience, a Docker image is available at Dockerhub:

docker run -it gongcastro/pymbrola:latest

Troubleshooting#

  • Ensure MBROLA and the required voices are installed and available at /usr/share/mbrola/<voice>/<voice>.

  • If you encounter an error about platform support, make sure you are running on Linux or WSL.

  • Write an issue, I’ll look into it ASAP.

Supported by#

Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency (ERCEA). Neither the European Union nor the granting authority can be held responsible for them. This work is supported by the ERC StG 101115991 (GALA) awarded to Chiara Santolin

erc