Flite tts demo fails to run

吃可爱长大的小学妹 提交于 2019-12-12 05:37:49

问题


I have recently been trying to use the Flite text-to-speech system (2.0) in a project of mine and when I call flite_text_to_speech() the program exits with this message:

VAL: tried to access lexicon in -1 type val

I made a small test program based on the code provided in the Flite documentation found here:

/* File: test.cpp */
#include <flite.h>

int main(int argc, char **argv)
{
    cst_voice *v;
    flite_init();
    v = new_voice();
    flite_text_to_speech("This is a test",v,"play");
    return 0;
}

This compiles cleanly with:

g++ -Wall -g -o flite_test test.cpp -I/usr/local/include/flite -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex -lflite -lasound -lm

However, when I run ./flite-test, I still get the same error:

VAL: tried to access lexicon in -1 type val

Is this a bug in Flite or am I doing something foolish here? I know that Flite 2.0 is relatively young so I'm considering using an older version but I would much rather use the latest. Does my test code work for anyone, and if so, what should I be doing differently?

Update: I just tried the this with Flite 1.4 and the same thing happens.


回答1:


I studied the flite utility's source and I was able to solve my issues by copying heavily from its main function in flite_main.c.



来源:https://stackoverflow.com/questions/28403734/flite-tts-demo-fails-to-run

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!