首页 > 代码库 > CentOS 5下freeswitch中集成使用ekho实现TTS功能二
CentOS 5下freeswitch中集成使用ekho实现TTS功能二
三:以上Festival安装完成以后回到ekho安装目录:
执行./configure --enable-festival 前
更改configure
1:替换
#AC_DEFINE(ENABLE_FESTIVAL,,[Enable Festival])
#LIB_FESTIVAL="${srcdir}/lib/libFestival.a ${srcdir}/lib/libestools.a ${srcdir}/lib/libestbase.a ${srcdir}/lib/libeststring.a -lncurses"
# CFLAG_FESTIVAL="-I${srcdir}/include/festival -I${srcdir}/include/speech_tools"
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd‘:" >&5
$as_echo "$as_me: error: in \`$ac_pwd‘:" >&2;}
as_fn_error $? "ncurses test failed
See \`config.log‘ for more details" "$LINENO" 5; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lestools" >&5
$as_echo_n "checking for main in -lestools... " >&6; }
if ${ac_cv_lib_estools_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lestools
$LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_estools_main=yes
else
ac_cv_lib_estools_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_estools_main" >&5
$as_echo "$ac_cv_lib_estools_main" >&6; }
if test "x$ac_cv_lib_estools_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBESTOOLS 1
_ACEOF
LIBS="-lestools $LIBS"
改为:
$as_echo "#define ENABLE_FESTIVAL /**/" >>confdefs.h
LIB_FESTIVAL="${srcdir}/lib/libFestival.a ${srcdir}/lib/libestools.a ${srcdir}/lib/libestbase.a ${srcdir}/lib/libeststring.a -lncurses"
CFLAG_FESTIVAL="-I${srcdir}/include/festival -I${srcdir}/include/speech_tools"
2:替换
as_fn_error $? "estool test failed
See \`config.log‘ for more details" "$LINENO" 5; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lFestival" >&5
$as_echo_n "checking for main in -lFestival... " >&6; }
if ${ac_cv_lib_Festival_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lFestival
$LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_Festival_main=yes
else
ac_cv_lib_Festival_main=no
改为:
as_fn_error "ncurses test failed (--disable-festival to disable)
See \`config.log‘ for more details." "$LINENO" 5; }
3去掉:
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Festival_main" >&5
$as_echo "$ac_cv_lib_Festival_main" >&6; }
if test "x$ac_cv_lib_Festival_main" = xyes; then :
$as_echo "#define ENABLE_FESTIVAL /**/" >>confdefs.h
LIB_FESTIVAL="-lFestival -lestbase -lestools -leststring -lncurses"
CFLAG_FESTIVAL="-I/usr/include/festival -I/usr/include/speech_tools"
else
$as_echo "#define ENABLE_FESTIVAL /**/" >>confdefs.h
LIB_FESTIVAL="${srcdir}/lib/libFestival.a ${srcdir}/lib/libestools.a ${srcdir}/lib/libestbase.a ${srcdir}/lib/libeststring.a -lncurses"
CFLAG_FESTIVAL="-I${srcdir}/include -I${srcdir}/include/festival -I${srcdir}/include/speech_tools"
else
LIB_FESTIVAL=""
CFLAG_FESTIVAL=""
Fi
4:添加:
else
with_mp3lame=no
fi
后添加
LIBS="-lasound $LIBS"
5以上更改以后:
在ekho安装目录下:
执行make
出现以下错误:
src/libekho.cpp:58:31: 错误:festival/festival.h:没有那个文件或目录
src/libekho.cpp: In member function ‘int ekho::Ekho::initFestival()’:
src/libekho.cpp:252: 错误:‘festival_initialize’ 在此作用域中尚未声明
src/libekho.cpp:257: 错误:‘strintern’ 在此作用域中尚未声明
src/libekho.cpp:257: 错误:‘siod_set_lval’ 在此作用域中尚未声明
src/libekho.cpp:261: 错误:‘festival_load_file’ 在此作用域中尚未声明
src/libekho.cpp:269: 错误:‘festival_tidy_up’ 在此作用域中尚未声明
src/libekho.cpp: In member function ‘int ekho::Ekho::writeToSonicStream(short int*, int, bool, bool)’:
src/libekho.cpp:752: 警告:当转换到 ‘short int’ (从 ‘double’)时
src/libekho.cpp:762: 警告:当转换到 ‘int’ (从 ‘float’)时
src/libekho.cpp: In member function ‘const char* ekho::Ekho::getPcmFromFestival(std::string, int&)’:
src/libekho.cpp:1203: 错误:‘festival_eval_command’ 在此作用域中尚未声明
src/libekho.cpp:1218: 错误:‘EST_Wave’ 在此作用域中尚未声明
src/libekho.cpp:1218: 错误:expected `;‘ before ‘wave’
src/libekho.cpp:1219: 错误:‘wave’ 在此作用域中尚未声明
src/libekho.cpp:1219: 错误:‘festival_text_to_wave’ 在此作用域中尚未声明
src/libekho.cpp:1225: 错误:‘EST_TVector’ 在此作用域中尚未声明
src/libekho.cpp:1225: 错误:expected primary-expression before ‘short’
src/libekho.cpp:1225: 错误:expected `;‘ before ‘short’
src/libekho.cpp:1226: 错误:‘tvector’ 在此作用域中尚未声明
make[1]: *** [src/libekho_a-libekho.o] 错误 1
make[1]: Leaving directory `/home/new_uucc_soft/ekho-6.0‘
make: *** [all] 错误 2
解决方法:
用命令:mkdir /usr/include/festival
cd /usr/include/festival
拷贝festival.h fngram.h intonation.h lexicon.h Makefile ModuleDescription.h modules.h module_support.h Phone.h text.h
到festival文件夹下
6.回到ekho安装目录下:
执行make:
出现:
g++: ./lib/libFestival.a: No such file or directory
g++: ./lib/libestools.a: No such file or directory
g++: ./lib/libestbase.a: No such file or directory
g++: ./lib/libeststring.a: No such file or directory
make[1]: *** [test_ekho] 错误 1
解决办法:
在ekho安装目录下执行:
cp lib32 lib
在festival和speech_tools的安装目录下面将.a文件
/festival/src/lib/中的libFestival.a拷贝到ekho安装目录下的lib中并覆盖
/speech_tools/lib/中的libestools.a libestbase.a libeststring.a拷贝到ekho安装目录下的lib中并覆盖
最后,执行make && make install ,安装完成
CentOS 5下freeswitch中集成使用ekho实现TTS功能二