Adding MBROLA speech to FreeTTS Java speech synthesiser

Welcome to the third in the series on adding speech to a Java application.  In the previous post, we wrote a small application to list out all the voices available in our Java FreeTTS speech synthesiser.

In this article, we will take a look at increasing the number of voices available to us by adding voices from MBROLA.

External files

As has become our habit, before we go too far, we will take a look at the external files needed to complete this section.

The MBROLA engine is included with the FreeTTS zip file as a JAR file we are going to downloaded the MBROLA engine as an executable file and can be downloaded from here:

http://tcts.fpms.ac.be/synthesis/mbrola/bin/pcdos/mbr301d.zip

This gives you a zip file with the mbrola.exe file contained within.

Next, we need to download some voices to work with our engine. The voices I will use are the three American voices.  I was unable to get the British voice to work and as yet I have not tried any of the others.  You can download the voices from here:

http://tcts.fpms.ac.be/synthesis/mbrola.html

Once on the page select the “Download” option and then click on “MBROLA binary and voices” and scroll down towards the bottom of the page where the various voices are listed.  Click on each of the US voices (US1, US2, US3) to download the three zip files containing the voices.

Setting up MBROLA

To install MBROLA so we can use it we need to extract the executable file from the zip file and place it on our local drive.  Now there are two versions of the file contained within the zip file, one is a Windows file and the other is a DOS file.  Surprisingly, we need the DOS base file which is located in the subdirectory “mbr302a”.  Simply extract the file to your local drive.  In my case, I went with C:\mbrola\mbrola.exe.

Once the executable file is in place next, we need to install the voices.  To install a voice simply extract the contents of the zip file into the same location as the MBROLA executable file.  You will end up with a folder for each voice and within the folder the voice-specific files.

The Code

Now that the MBROLA files are in place we can turn our attention to our code and make use of these new files.

To use MBROLA in our Java application we need to set the property “mbrola.base” to the location where the executable MBROLA file is located.  With this in place we can run our Java application, the same application we used in the previous post, and now see we have an additional voice available.

The code for this looks like this:

And this gives us the following results

alan – default time-domain cluster unit voice
kevin – default 8-bit diphone voice
kevin16 – default 16-bit diphone voice
mbrola_us1 – MBROLA Voice us1
mbrola_us2 – MBROLA Voice us2
mbrola_us3 – MBROLA Voice us3

Notice that when we run the application this time there is no warning about “mbrola.base” being undefined which we saw in the previous version.  We now have our MBROLA voices ready to use.

There is no download for this post as the code for this is only 1 line different from the previous posting and all the external files were provided as well.  Take a look at the JavaFX and adding basic speech post for the download link.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.