我是unix的初学者,也是flite的初学者。
#include "flite.h"
cst_voice *register_cmu_us_kal();
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");
}从上面的程序中,我了解到register_cmu_us_kal()将返回一个英语语音。在argv1中输入的文件将以英语读取。
cst_wave *flite_text_to_wave(const * text,cst_voice *cst_voice);=>用于文本到波形
我正在做一个应用程序代码已经存在的项目,我希望将显示的文本转换为语音。register_cmu_us_kal()我不明白它是做什么的。如何查看flite.h库中可用的不同函数及其功能。
请帮助理解
发布于 2012-09-19 07:03:21
在argv1中输入的文件将以英语读取。
cst_wave *flite_text_to_wave(const * text,cst_voice *cst_voice);=>用于文本到波形
这个函数将返回一个cst_wave*,而不是读出它,读取给定文本的函数是
float flite_text_to_speech(const char *text, cst_voice *voice, const char *outtype);
它应该被称为flite_text_to_speech("Hello world!", v, "play");。
函数cst_voice *register_cmu_us_kal(const char*);被调用,以便在程序将要使用这个cst_voice的flite引擎中注册。若要查看机器上可用的声音列表,请执行命令
flite -lv
是可以给予的。我的机器输出
提供
声音: kal awb_time kal16 awb rms slt
因此,我可以注册所有上述声音,以便与flite_text_to_speech函数一起使用。
https://stackoverflow.com/questions/8510195
复制相似问题