- 论坛徽章:
- 0
|
Festival编译笔记
ubuntu+gcc
festival
编译festival
1.编译原材料
http://festvox.org/packed/festival/1.96/
festival-1.96-beta.tar.gz
speech_tools-1.2.96-beta.tar.gz
2.编译festival
a.把两个包解压到同一级目录中 因为festival编译时需要speech_tools
b.分别 ./configure ... make
使用festival开发tts
1.例子
#include
#include
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)");
//festival_eval_command("voice_default");
// Say some text;
festival_say_text("pan hui ni hao ");
// 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;
}
这是manual上的例子 很简单 实现 TTS 并且可以保存成wav(网站上的demo一般都是提供wav文件下载)
2.头文件
-I/home/huipan/study/speech_tools/include -I/home/huipan/study/festival-1.96~beta
如此 把编译的目录都能包含进来.
单纯的使用festival-dev 头文件不够
3.link
-lFestival -lesd -lncurses -leststring -lestbase -lestools
-lesd -lncurses 调这两个费了不少时间
只是一则备忘
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1073/showart_1341817.html |
|