I want to use Festival TTS with my C++ programme.
So i have downloaded all files form http://www.cstr.ed.ac.uk/downloads/festival/2.0.95/
then i start reading manual(http://www.cstr.ed.ac.uk/projects/festival/manual/festival_28.html) for C++ API but in manual they says that:
In order to use Festival you must include festival/src/include/festival.h' which in turn will include the necessary other include files in
festival/src/include' and speech_tools/include' you should ensure these are included in the include path for you your program. Also you will need to link your program with
festival/src/lib/libFestival.a', speech_tools/lib/libestools.a',
speech_tools/lib/libestbase.a' and `speech_tools/lib/libeststring.a' as well as any other optional libraries such as net audio. "
I am using UBUNTU 10.04(festival package is by default installed and i can use it form terminal by festival command) and GCC 4.4.3
but the problem is that i am new to GCC and i am n开发者_如何学Pythonot understanding which files i have to include in order to run my C++ code and i also don't know how to link libraries with my c++ code.
So please tell me exactly which files i have to include and how to link with libraries if anyone already use festival tts with c++ then please post your code
Thanks
1) #include <festival.h>
at the beginning of your program (because you have it installed). It could also be festival/festival.h
or something like that (it depends on how does the package install) - and I can't say exactly, because I've never used it. Still I assume the first variant would work by default.
2) Link all the libraries you need (those three which you'll definitely need are listed in your bold text) using appropriate GCC switch. If you're not familiar with GCC syntax, you'd better read some manuals / google it, because there's a lot of important information.
P.S Instead of adding the static libraries via console switch, you could definitely write an appropriate makefile for your project. But the situation here is the same as with GCC switches - there is are many different manuals about using makefiles and I definitely won't copy/paste them in this answer.
4 years old. Perhaps it has been solved. Anyway.
I strongly recommend you use CMAKE for that. You need to use:
set(EST_DIR "${CMAKE_CURRENT_LIST_DIR}/")
find_package(EST REQUIRED)
set(Festival_DIR "${CMAKE_CURRENT_LIST_DIR}/")
find_package(Festival REQUIRED)
INCLUDE_DIRECTORIES(include ${CMAKE_SOURCE_DIR}
${EST_INCLUDE_DIR}
${Festival_INCLUDE_DIR})
file(GLOB_RECURSE headers "include/*.h*")
file(GLOB_RECURSE sources "src/*.c*")
add_executable(festivalProject ${sources} ${headers} )
target_link_libraries(Project ${EST_LIBRARIES} ${Festival_LIBRARIES})
For that you will need 2 files at the same location of your CMakeLists.txt file:
- ESTConfig.cmake - Source Here
- FestivalConfig.cmake - Source Here
NOtice that you will need both, EST and Festival to make it compile (Festival depends on EST). Of course you can also dive in your hard drive and #include/link directly against every file you need.
While the festival command line program might be installed, the headers for developing programs based on festival are in a different package -- ensure that you've got the festival-dev
package installed too.
精彩评论