pymbrola
A Python interface for the MBROLA speech synthesizer, enabling programmatic creation of MBROLA-compatible phoneme files and automated audio synthesis. This module validates phoneme, duration, and pitch sequences, generates .pho files, and can call the MBROLA executable to synthesize speech audio from text-like inputs.
References: Dutoit, T., Pagel, V., Pierret, N., Bataille, F., & Van der Vrecken, O. (1996, October). The MBROLA project: Towards a set of high quality speech synthesizers free of use for non commercial purposes. In Proceeding of Fourth International Conference on Spoken Language Processing. ICSLP'96 (Vol. 3, pp. 1393-1396). IEEE. https://doi.org/10.1109/ICSLP.1996.607874
Installation
You can install pymbrola from the PyPi repository using pip or uv:
pip install mbrola # pip installation
uv add mbrola # uv installation
In either case, you will need Python>=3.10. To synthesise audios via MBROLA, you will need to download it and compile it. The pymbrola package has functions for this. This will download MBROLa from numediat/MBROLA to you home folder ~/.mbrola and compile it.
import mbrola
mbrola.install_mbrola()
Finally, you will need to download some MBROLA voices from numediart/MBROLA-voices. These voices will be automatically downloaded and found by pymbrola at ~/.mbrola/Voices:
mbrola.install_voice("it4") # install it4 voice
mbrola.install_voice(["it4", "fr4"]) # install several voices
mbrola.install_voice() # install all voices (~534M)
Usage
import mbrola
# Create an MBROLA object
caffe = MBROLA(
phon=["k", "a", "f", "f", "E1"],
durations=100, # or [100, 120, 100, 110]
pitch=[100, [200, 50, 200], 100, 100, 200],
)
# Display phoneme sequence
print(caffe)
# Export PHO file
caffe.export_pho("caffe.pho")
# Synthesize and save audio (WAV file)
caffe.make_sound("caffe.wav", voice="it4")
The mbrola module uses the MBROLA command line tool under the hood. Ensure MBROLA is installed and available in your system path, or WSL if on Windows.
License
pymbrola is distributed under the terms of the MIT license.
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
Metadata
Release files for mbrola 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mbrola-0.6.0.tar.gz | 13.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mbrola-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.3 kB
Release files / mbrola-0.6.0.tar.gz
| Download URL | mbrola-0.6.0.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cb45a84f6921d73c344b62d26124823b489b70520643312a2a95ab0f62ac966
|
|
BLAKE2b-256 checksum How to use checksums |
7428cb546ee4cab320eac27932465f59f501cb1ffef135c9ecc83ee1f4d6fc30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mbrola-0.6.0-py3-none-any.whl
| Download URL | mbrola-0.6.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c71c2daaf5bb7d95780126c142bd004e1537bc9c4105608164323b0c02c00e1c
|
|
BLAKE2b-256 checksum How to use checksums |
9bf2b986fdcdef766512eb54307c7d1a709042b83b724a7ca11e88deedb10ed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|