Flite tts demo无法运行

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

 VAL: tried to access lexicon in -1 type val 

我根据Flite文档中提供的代码制作了一个小测试程序:

 /* File: test.cpp */ #include  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尝试了这个,同样的事情发生了。

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