How to add a new voice to MBROLA - FreeTTS

5.5k views Asked by At

I took several days trying to add different voices that us1, us2 and us3 in a project with MBROLA and FreeTTS. I'm working with Eclipse on Windows (64bits)

I have read all this messages:

How to change voice in FreeTTS - Java

freetts - text to speech setting mbrola voice com.sun.speech.freetts.ProcessException: Processing Utterance:

MBROLA voices with FreeTTS - Windows

FreeTTS mbrola not able to find path

How to change voice in FreeTTS - Java

and this other

http://sourceforge.net/p/freetts/discussion/137669/thread/848a09ab

These are the steps I've done:

1.- First i read Freetts docs http://freetts.sourceforge.net/docs/index.php#download_and_install

2.- I've donwload

freetts-1.2.2-src.zip and freetts-1.2.2-bin.zip

3.- I've created new Eclipse Project and I've added

freetts-1.2.2-src\freetts-1.2.2\demo\freetts\HelloWorld\FreeTTSHelloWorld.java

4.- Import jar

freetts-1.2.2-bin\freetts-1.2\lib\freetts.jar

When running, in the console I get

All voices available:
System property "mbrola.base" is undefined.  Will not use MBROLA voices.
    alan (time domain)
    kevin (general domain)
    kevin16 (general domain)

Using voice: kevin16
System property "mbrola.base" is undefined.  Will not use MBROLA voices.

Then I've donwload MBROLA PC/DOS binary

mbr301d.zip 

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

I've unzip this at

C:\Users\Usuario\Downloads\mbr301d

and added the us1, us2 and us3 voices. The folder structure is:

mbr302a (folder)
us1 (folder)
us2 (folder)
us3 (folder)
mbrola.exe
readme.txt

Now i set mbrola.base

System.setProperty("mbrola.base", "C:\\Users\\Usuario\\Downloads\\mbr301d");

And when i run again:

All voices available:
    alan (time domain)
    kevin (general domain)
    kevin16 (general domain)
    mbrola_us1 (general domain)
    mbrola_us2 (general domain)
    mbrola_us3 (general domain)

Using voice: mbrola_us1 

Everything works perfect with those voices. But i need working with spanish voices. Then i've donwload from MBROLA website

es1: Spanish Male (2.1Mb)    Alistair Conkie
es2: Spanish Male (5.1Mb)    TCC Communications Corp.
es3: Spanish Female (1.9Mb)    Universidad Carlos III de Madrid

and unzip at my MBROLA folder

mbr302a (folder)
us1 (folder)
us2 (folder)
us3 (folder)
es1 (folder)
es2 (folder)
es3 (folder)
mbrola.exe
readme.txt

But when i run again, not found. I get the same voices than before.

Has anyone run mbrola with different voices than us1, us2 and us3? What steps i need follow to configure the new voices?

1

There are 1 answers

0
Moritz Hein On

I'm also experimenting with mbrola voices right now and tried to add some German and Japanese voices which also didn't work. After a while searching I think I found the problem. In the lib folder (the folder which contains freetts.jar) there is also a mbrola.jar file. In the MbrolaVoiceDirectory.class it registers all mbrola voices and in there only us1, us2 and us3 are registered. Right now I'm trying to edit this file, compile it again and then replace the mbrola.jar with the new file. I'll tell you if it worked.

EDIT: It worked half I think ^^ I can now load German or Japanese or any other voice but somehow I can't really let it say something. Maybe its because I'm trying out the different voices with the same English text. Here's a quick list what I did to use the other voices:

  1. Decompile mbrola.jar in the lib folder

  2. Edit the MbrolaVoiceDirectory.java file in the package de.dfki.lt.freetts.en.us. I changed the code to this: http://pastebin.com/aUxw3FDv This automatically searches for voice folders and it should work all the time for every language. Just put the folder with the language identifier (for example "us" or "de" or "es") and then a number in the mbola.base folder

  3. Then I recompiled it to a not runnable jar, opened the jar (with WinRaR or sth like that) and replaced the META-INF folder in there with the META-INF folder of the original mbrola jar file.

And here is the jar file which loads the voices: https://www.dropbox.com/s/i51mazz1wv39pn2/mbrola.jar?dl=0

I hope it works for you.

Moritz