text-to-speechfreettsmbrola

mbrola Binary for linux CentOS


I am trying to use mbrola binary on CentOS box. I tried many binary listed on below page but none is working. http://www.tcts.fpms.ac.be/synthesis/mbrola/mbrcopybin.html

I am getting following error -

Processing Utterance: com.sun.speech.freetts.ProcessException: Cannot start mbrola program:

I believe this is most likely incompatible binary for CentOS. Can you please tell me if there is a binary available for CentOS ?

Code -

public static void createAudioFile(String text, String fileName) {
        AudioPlayer audioPlayer = null;

        //System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_time_awb.AlanVoiceDirectory");
        System.setProperty("mbrola.base", Constants.mbrolaDiskPath);
        Voice voice;
        VoiceManager vm =  VoiceManager.getInstance();
        voice = vm.getVoice("mbrola_us1");
        voice.allocate();

        try{
            String directoryPath = audioDir+fileName;
            audioPlayer = new SingleFileAudioPlayer(directoryPath,Type.WAVE);
            voice.setAudioPlayer(audioPlayer);
            voice.speak(text);
            voice.deallocate();
            audioPlayer.close();

        }
        catch(Exception e){
            e.printStackTrace();
        }

    }

Solution

  • I found Mbrola binary for CentOs from following location - http://rpm.pbone.net/index.php3/stat/4/idpl/30430620/dir/centos_7/com/mbrola-301h-7.1.x86_64.rpm.html#content

    Steps to follow - 1. Download the following rpm ftp.gwdg.de mbrola-301h-7.1.x86_64.rpm

    1. run > rpm -ivh mbrola-301h-7.1.x86_64.rpm. This will install mbrola binary into /usr/bin.

    2. Copy /usr/bin/mbrola to your preferred location and set mbrola.base to it as - System.setProperty("mbrola.base", Constants.mbrolaDiskPath);

    done.