Hi all. I am attempting to write a program using Festival as the TTS output. It is a weather system, so
1) takes raw data from sensors on the input.
2) converts it into a text message
3) let festival take the message and turn it into audio that I can then route out to the telephone system.
Here is my main block of code using festival:
Code:
void *process(void* buf)
{
char *message;
message = (char *) buf;
printf("%s", message);
EST_String words = message;
printf("it's called here \n");
for(int i = 0; i<20; i++) {
printf("%s\n", message);
festival_say_text(words);
usleep(900000);
printf("finished festival\n\n");
}
If in the main calling function I call it directly:
It works as expected.
However, if I try to put it into another thread:
Code:
pthread_create( &process1, NULL, process, (void*) sbuf);
I get the following output:
Code:
SIOD ERROR: the currently assigned stack limit has been exceded
which is coming from the function
Code:
festival_say_text(words);
I imagine some of my problem is being a C/C++ newbie, but is there anybody out there able to give me some hints? Maybe there is a different or better way to fork that process.
My plan is to keep updating the buffer whose pointer is passed to the function process() with my serial port processing program in the main loop. I can protect it with a mutex during the festival_say_text() function, but otherwise it will be accessible. If there are other ways to fork a process than pthread, then also those types of hints may help too.
Thanks in advance.