Skip to main content

pymbrola

GitHub Actions Workflow Status PyPI - Version PyPI - Python Version GitHub License PyPI - Status Docker Image Size (tag) GitHub Release Codecov


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

Features

  • Front-end to MBROLA: Easily create .pho files and synthesize audio with Python.
  • Input validation: Prevents invalid file and phoneme sequence errors.
  • Customizable: Easily set phonemes, durations, pitch contours, and leading/trailing silences.

Requirements

  • Python 3.10+
  • MBROLA binary installed and available in your system path, or via WSL for Windows users.
  • MBROLA voices (e.g., it4) must be installed at /usr/share/mbrola/<voice>/<voice>.

To install MBROLA in your Ubuntu or WSL instance, run the [mbrola/install.sh] script:

sudo bin/install.sh --voice fr2 it4 # install voices fr2 and it4
sudo bin/install.sh --voice all     # install all voices
sudo bin/install.sh                 # install no voices

Installation

MBROLA is currently available only on Linux-based systems like Ubuntu, or on Windows via the Windows Susbsystem for Linux (WSL). Install MBROLA in your machine following the instructions in the MBROLA repository. If you are using WSL, install MBROLA in WSL. After this, you should be ready to install pymbrola using pip.

pip install mbrola

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 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.

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.

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

https://erc.europa.eu/homepage{ width="400" alt="erc-logo" }

Metadata

Release files for mbrola 0.5.2

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

Source distribution (sdist)

Source distribution for mbrola 0.5.2
File Size Uploaded
mbrola-0.5.2.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mbrola 0.5.2
File Interpreter ABI Platform
mbrola-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / mbrola-0.5.2.tar.gz

Download URL mbrola-0.5.2.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a563004c17e2cbaa9e7d4fa1f1842b8f7994186a10cc3c47b2376888d5d0e0de
BLAKE2b-256 checksum
How to use checksums
1efeea0ddd6456b10d3b5a6397a4f60dea71a0e333eebe5e03c434af2805585d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mbrola-0.5.2-py3-none-any.whl

Download URL mbrola-0.5.2-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f24c586924f068b8510c1ecbe87fc3010bccad9877ea9cea58a73a4b5abfcc2
BLAKE2b-256 checksum
How to use checksums
68ee10c069100438780b3c635dd59ff730a8a8ae526505f2140082e6075e7797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.6.0

2 release files

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.0

2 release files

0.3.28

2 release files

0.3.27

2 release files

0.3.26

2 release files

0.3.25

2 release files

0.3.24

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.20

2 release files

0.3.19

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

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