Flite tts demo无法运行

时间:2015-02-09 06:07:06

标签: c++ c flite

我最近一直在尝试在我的项目中使用Flite文本转语音系统(2.0),当我调用flite_text_to_speech()程序退出时会显示以下消息:

VAL: tried to access lexicon in -1 type val

我根据Flite文档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;
}

这完全符合:

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

但是,当我运行./flite-test时,我仍然会遇到同样的错误:

VAL: tried to access lexicon in -1 type val

这是Flite中的一个错误还是我在这里做了一些愚蠢的事情?我知道Flite 2.0比较年轻,所以我考虑使用旧版本,但我更愿意使用最新版本。我的测试代码是否适用于任何人,如果适用,我应该采取哪些不同的做法?

更新:我刚用Flite 1.4尝试了这个,同样的事情发生了。

1 个答案:

答案 0 :(得分:1)

我研究了flite实用程序的源代码,我能够通过从flite_main.c中的主函数中大量复制来解决我的问题。

相关问题