flite的使用

By admin, 5 十二月, 2022

源码:https://github.com/festvox/flite

使用文档:http://www.festvox.org/flite/doc/flite_7.html#C-example

示例代码:

 

#include "flite.h"
cst_voice *register_cmu_us_kal(const char *voxdir); // 注意这一行和官方文档不同,官方文档的会报错。

int main(int argc, char **argv)
{
    cst_voice *v;

    if (argc != 2)
    {
        fprintf(stderr,"usage: flite_test FILE\n");
        exit(-1);
    }

    flite_init();

    v = register_cmu_us_kal(NULL);

    flite_file_to_speech(argv[1],v,"play");

}

静态编译(Ubuntu 22.04下不行):

gcc -Wall -g -o flite_test flite_test.c -Iinclude build/x86_64-darwin21.6.0/lib/*.a 

动态编译:

Ubuntu 22.04下编译flite是需要加上--enable-shared参数:

./configure --enable-shared

make

gcc -Wall -g -o flite_test flite_test.c -Iinclude -Lbuild/x86_64-linux-gnu/lib -lasound -lm -lflite -lflite_cmu_us_kal

标签

评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal10"