适用于Linux CentOS的mbrola Binary

时间:2016-03-26 03:39:26

标签: text-to-speech freetts mbrola

我想在CentOS盒子上使用mbrola二进制文件。我在下面的页面上尝试了很多二进制文件但没有一个正常工 http://www.tcts.fpms.ac.be/synthesis/mbrola/mbrcopybin.html

我收到以下错误 -

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

我认为这很可能是CentOS不兼容的二进制文件。 如果CentOS有二进制文件,你能告诉我吗?

代码 -

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();
        }

    }

1 个答案:

答案 0 :(得分:0)

我从以下位置找到了CentOs的Mbrola二进制文件 - http://rpm.pbone.net/index.php3/stat/4/idpl/30430620/dir/centos_7/com/mbrola-301h-7.1.x86_64.rpm.html#content

要遵循的步骤 - 1.下载以下rpm ftp.gwdg.de mbrola-301h-7.1.x86_64.rpm

  1. 运行> rpm -ivh mbrola-301h-7.1.x86_64.rpm。这会将mbrola二进制文件安装到/ usr / bin中。

  2. 将/ usr / bin / mbrola复制到您的首选位置,并将mbrola.base设置为 - System.setProperty("mbrola.base", Constants.mbrolaDiskPath);

  3. 完成。