【问题标题】:Flite tts demo fails to runFlite tts 演示无法运行
【发布时间】:2015-02-09 06:07:05
【问题描述】:

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

VAL: tried to access lexicon in -1 type val

我根据here找到的Flite文档中提供的代码做了一个小测试程序:

/* 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 尝试了这个,同样的事情发生了。

【问题讨论】:

    标签: c++ c flite


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-13
      • 1970-01-01
      • 2012-08-21
      • 2015-10-24
      相关资源
      最近更新 更多