I build flite for windows, the code is:
#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 FILE\n");
exit(-1);
}
flite_init();
v = new_voice();
flite_text_to_speech("This is a test",v,"play");
return 0;
}
but I get the printf message "usage: ", if I delete that I get this "tried to access lexicon in -1 type val flite". I am on windows so I call project.exe without the arguments in the documentation. Do you know how to fix this ?
As said in the comments you should remove the parameters count (
argc
) check.In addition: When you call
new_voice
method you get uninitializedcst_voice
and you still can't use it.Thats why you get the error:
It is mean the lex (
cst_lexicon
) is still uninitialized in thecst_voice
structure.I guess you need to do something like the following code: