Compiling Festival applications

As suggested in its docs page, there are some details in compiling and linking Festival C/C++ applications. You need to install at least libesd0-dev, libncurses5-dev and festival-dev (on Ubuntu 8.04). I test by copy the simple example from their page to my source test_festival.cpp which is

//file: test_festival.cpp
#include <festival.h>
 
int main(int argc, char **argv)
{
    EST_Wave wave;
    int heap_size = 210000;  // default scheme heap size
    int load_init_files = 1; // we want the festival init files loaded
 
    festival_initialize(load_init_files,heap_size);
 
    // Say simple file
    festival_say_file("/etc/motd");
 
    festival_eval_command("(voice_ked_diphone)");
    // Say some text;
    festival_say_text("hello world");
 
    // Convert to a waveform
    festival_text_to_wave("hello world",wave);
    wave.save("/tmp/wave.wav","riff");
 
    // festival_say_file puts the system in async mode so we better
    // wait for the spooler to reach the last waveform before exiting
    // This isn't necessary if only festival_say_text is being used (and
    // your own wave playing stuff)
    festival_wait_for_spooler();
 
    return 0;
}

To compile and build it, I do the following commands:

$g++ -c test_festival.cpp \\
-I /usr/include/estools -I /usr/include/festival/
$g++ -o test_festival test_festival.o \\
-lFestival -lestools -lestbase -leststring -lesd -lncurses

Finally, type ./test_festival to run it. Cool! isn’t it?

Related Posts

One Response to “Compiling Festival applications”

  1. That is pretty awesome. Is there any way to set it so it uses the hidden markov model voices that they have on their site?

    Thanks

Leave a Reply