I have recently been trying to use the Flite text-to-speech system (2.0) in a project of mine and when I call flite_text_to_speech()
the program exits with this message:
VAL: tried to access lexicon in -1 type val
I made a small test program based on the code provided in the Flite documentation found here:
/* 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;
}
This compiles cleanly with:
g++ -Wall -g -o flite_test test.cpp -I/usr/local/include/flite -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex -lflite -lasound -lm
However, when I run ./flite-test, I still get the same error:
VAL: tried to access lexicon in -1 type val
Is this a bug in Flite or am I doing something foolish here? I know that Flite 2.0 is relatively young so I'm considering using an older version but I would much rather use the latest. Does my test code work for anyone, and if so, what should I be doing differently?
Update: I just tried the this with Flite 1.4 and the same thing happens.