diff --git a/configure.ac b/configure.ac index 253ae23b3..2e599906e 100644 --- a/configure.ac +++ b/configure.ac @@ -118,14 +118,6 @@ fi AC_CHECK_HEADER(pthread.h) AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes") -dnl Festival related checks -# defaults to yes -AC_ARG_WITH(festival, [ --with-festival Use festival speech software [default=no]], [], [with_festival=no]) -if test "x$with_festival" = "xyes"; then - AC_DEFINE([USE_FESTIVAL], 1, [Define to enable festival speech software]) -fi -AM_CONDITIONAL(USE_FESTIVAL, test "x$with_festival" = "xyes") - dnl Used by JSBSim to conditionally compile in fgfs interface code AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode]) diff --git a/src/ATC/ATC.cxx b/src/ATC/ATC.cxx index b95d00085..b7be2f644 100644 --- a/src/ATC/ATC.cxx +++ b/src/ATC/ATC.cxx @@ -31,10 +31,6 @@ #include "ATCdisplay.hxx" #include "voice.hxx" -#ifdef USE_FESTIVAL -FGVoice *p_Voice = new FGVoice(); -#endif - FGATC::FGATC() { freqClear = true; receiving = false; @@ -244,14 +240,8 @@ void FGATC::Render(string& msg, const string& refname, bool repeating) { globals->get_soundmgr()->add(simple, refname); if(repeating) { globals->get_soundmgr()->play_looped(refname); -#ifdef USE_FESTIVAL - p_Voice->send_transcript( msg , refname, 1 ); -#endif } else { globals->get_soundmgr()->play_once(refname); -#ifdef USE_FESTIVAL - p_Voice->send_transcript( msg , refname, 0 ); -#endif } } delete[] buf; @@ -266,14 +256,8 @@ void FGATC::Render(string& msg, const string& refname, bool repeating) { } if(repeating) { globals->get_ATC_display()->RegisterRepeatingMessage(msg); -#ifdef USE_FESTIVAL - p_Voice->send_transcript( msg , refname, 1 ); -#endif } else { globals->get_ATC_display()->RegisterSingleMessage(msg); -#ifdef USE_FESTIVAL - p_Voice->send_transcript( msg, refname, 0 ); -#endif } } _playing = true; @@ -287,9 +271,6 @@ void FGATC::NoRender(const string& refname) { #ifdef ENABLE_AUDIO_SUPPORT globals->get_soundmgr()->stop(refname); globals->get_soundmgr()->remove(refname); -# ifdef USE_FESTIVAL - p_Voice->send_transcript( "--", refname, 2); -# endif #endif } else { globals->get_ATC_display()->CancelRepeatingMessage(); diff --git a/src/ATC/Makefile.am b/src/ATC/Makefile.am index 20424a775..2107b12cf 100644 --- a/src/ATC/Makefile.am +++ b/src/ATC/Makefile.am @@ -1,11 +1,5 @@ noinst_LIBRARIES = libATC.a -if USE_FESTIVAL -VOICE_SRC = voice.cxx voice.hxx -else -VOICE_SRC = -endif - libATC_a_SOURCES = \ ATC.hxx ATC.cxx \ atis.hxx atis.cxx \ @@ -25,7 +19,6 @@ libATC_a_SOURCES = \ AILocalTraffic.hxx AILocalTraffic.cxx \ AIGAVFRTraffic.hxx AIGAVFRTraffic.cxx \ transmission.hxx transmission.cxx \ - transmissionlist.hxx transmissionlist.cxx \ - $(VOICE_SRC) + transmissionlist.hxx transmissionlist.cxx INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src diff --git a/src/ATC/voice.cxx b/src/ATC/voice.cxx deleted file mode 100644 index 1e4d068e8..000000000 --- a/src/ATC/voice.cxx +++ /dev/null @@ -1,83 +0,0 @@ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include STL_IOSTREAM -SG_USING_STD(cout); -SG_USING_STD(endl); - -#define ATC_SERVER_ADDRESS "192.168.2.15" // adddress of machine running festival server - -#include "voice.hxx" - -int atc_sockfd = 0; -int result, servlen; -struct sockaddr_in atc_serv_addr, atc_cli_add; - -//FGVoice *p_voice; - -bool FGVoice::send_transcript( string trans, string refname, short repeat ) -{ - string msg; - - switch ( repeat ) { - case 0: msg = "S " + refname + ">" + trans; - break; - case 1: msg = "R " + refname + ">" + trans; - break; - case 2: msg = "X " + refname; - break; - } - // strip out some characters - for(unsigned int i = 0; i < msg.length(); ++i) { - if((msg.substr(i,1) == "_") || (msg.substr(i,1) == "/")) { - msg[i] = ' '; - } - } - - int len = msg.length(); - if (sendto(atc_sockfd, (char *) msg.c_str(), len, 0, (struct sockaddr *) &atc_serv_addr, servlen ) != len) { - cout << "network write failed for " << len << " chars" << endl; - return false; - } - printf("Transmit: %s of %d chars\n", msg.c_str(), len ); - return true; -} - -FGVoice::FGVoice() -{ - string mesg = "Welcome to the FlightGear voice synthesizer"; - string welcome = "welcome "; -// Init the network stuff here - printf( "FGVoice created. Connecting to atc sim\n"); - servlen = sizeof( atc_serv_addr ); - bzero((char *) &atc_serv_addr, servlen); - atc_serv_addr.sin_family = AF_INET; - atc_serv_addr.sin_addr.s_addr = inet_addr(ATC_SERVER_ADDRESS); - atc_serv_addr.sin_port = htons(7100); - - if ((atc_sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - { - printf("Failed to obtain a socket\n"); -// return( 0 ); - } - else send_transcript( mesg, welcome, 0 ); -} - -FGVoice::~FGVoice() -{ - close( atc_sockfd ); -} diff --git a/src/ATC/voice.hxx b/src/ATC/voice.hxx deleted file mode 100644 index 67346119a..000000000 --- a/src/ATC/voice.hxx +++ /dev/null @@ -1,18 +0,0 @@ -// atc_voice.hxx -#include -#include - -#include STL_STRING -SG_USING_STD(string); - -class FGVoice -{ -public: - FGVoice(); - ~FGVoice(); - - bool send_transcript( string trans, string refname, short repeat ); - -}; -extern FGVoice *p_Voice; - diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index 7c116233c..35bcbc9ff 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -19,12 +19,6 @@ else THREAD_LIBS = endif -if USE_FESTIVAL -VOICE_LIBS = $(top_builddir)/src/Voice/libVoice.a -else -VOICE_LIBS = -endif - if USE_SDL GFX_CODE = fg_os_sdl.cxx fg_os.hxx else @@ -98,7 +92,7 @@ fgfs_LDADD = \ $(top_builddir)/src/Airports/libAirports.a \ $(MPLAYER_LIBS) \ $(top_builddir)/src/AIModel/libAIModel.a \ - $(VOICE_LIBS) \ + $(top_builddir)/src/Voice/libVoice.a \ $(top_builddir)/src/Systems/libSystems.a \ $(top_builddir)/src/Time/libTime.a \ $(top_builddir)/src/Traffic/libTraffic.a \