Windows上的Flite API错误
Flite API error on windows
我为Windows构建flite,代码是:
#include "..\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 FILEn");
exit(-1);
}
flite_init();
v = new_voice();
flite_text_to_speech("This is a test",v,"play");
return 0;
}
但是我收到printf消息"usage:",如果我删除该消息,我会得到此消息"尝试访问-1类型val flite中的词典"。我在 Windows 上,所以我调用项目.exe没有文档中的参数。 你知道怎么解决这个问题吗?
如注释中所述,您应该删除参数计数(argc
(检查。
另外:当你调用new_voice
方法时,你会得到未初始化的cst_voice
,你仍然无法使用它。
这就是您收到错误的原因:
尝试在 -1 型 val flite 中访问词典
这意味着 lex (cst_lexicon
( 在cst_voice
结构中仍未初始化。
我想你需要做一些类似于以下代码的事情:
cst_voice *register_cmu_us_no_wave()
{
cst_voice *v = new_voice();
cst_lexicon *lex;
v->name = "no_wave_voice";
/* Set up basic values for synthesizing with this voice */
usenglish_init(v);
feat_set_string(v->features,"name","cmu_us_no_wave");
/* Lexicon */
lex = cmu_lex_init();
feat_set(v->features,"lexicon",lexicon_val(lex));
/* Intonation */
feat_set_float(v->features,"int_f0_target_mean",95.0);
feat_set_float(v->features,"int_f0_target_stddev",11.0);
feat_set_float(v->features,"duration_stretch",1.1);
/* Post lexical rules */
feat_set(v->features,"postlex_func",uttfunc_val(lex->postlex));
/* Waveform synthesis: diphone_synth */
feat_set(v->features,"wave_synth_func",uttfunc_val(&no_wave_synth));
return v;
}
相关文章:
- 第三方 API 中的编译错误 - Visual Studio
- 分段错误(核心转储) - 使用 SavedModel 的 Tensorflow C++ API 进行推断
- 如何修复无效的API密钥,IP或操作权限错误?
- 使用 lua 协程 API 和lua_close时出现分段错误
- 两个线程一个使用流 Api,另一个线程创建文件失败并出现错误ERROR_SHARING_VIOLATION
- Win32 API - HWND "{unused = ???} Unable to read memory"错误
- 设置我的应用程序 API 感知并防止系统使其模糊和错误定位
- 从谷歌日历API获取错误请求
- 创建进程 API 失败,在窗口 122 上出现错误代码 10
- Windows上的Flite API错误
- QScreen geometry()api为分辨率2736 x 1824和2560 x 1600提供了错误的值
- cuda-gdb 给出错误"warning: Cuda API error detected: cudaLaunchKernel returned (0x7)"
- 使用N-API时如何避免分段错误
- 来自API的错误代码..处理什么是好的做法
- 内部编译器错误Visual Studio Community 2017与SFML API
- 节点 API 抛出自己的错误消息,而不是自己的错误消息
- azure-iot-sdk-c API IoTHubClient_LL_DoWork()失败并显示大量错误
- 如何在使用CreateRemoteThread API时修复"LPVOID: unknown size"错误?
- mmdevice API中的cocreateinstance返回错误代码0x800401f0
- Tensorflow c++ API 失败设置 gpu/cpu 编号:SetDefaultDevice 错误:具有相同优