diff --git a/Makefile.am b/Makefile.am index 7d172b38..9149e6dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,7 +64,6 @@ common_SOURCE = \ src/readclause.cpp \ src/phonemelist.cpp \ src/setlengths.cpp \ - src/sonic.cpp \ src/synthdata.cpp \ src/synthesize.cpp \ src/synth_mbrola.cpp \ @@ -105,6 +104,11 @@ common_FLAGS += -DINCLUDE_MBROLA common_SOURCE += src/mbrowrap.cpp endif +if OPT_SONIC +common_FLAGS += -DINCLUDE_SONIC +common_SOURCE += src/sonic.cpp +endif + if AUDIO_RUNTIME wave_SOURCE = src/wave.cpp src/wave_pulse.cpp wave_LIBS = -lpulse -lpulse-simple -lportaudio diff --git a/configure.ac b/configure.ac index 3d7d0e93..ecbc08b9 100644 --- a/configure.ac +++ b/configure.ac @@ -148,8 +148,19 @@ else have_mbrola=yes fi +AC_ARG_WITH([sonic], + [AS_HELP_STRING([--with-sonic], [enable the sonic library to speed up the audio @<:@default=yes@:>@])], + []) + +if test "$with_sonic" = "no" ; then + have_sonic=no +else + have_sonic=yes +fi + AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes]) AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes]) +AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes]) dnl ================================================================ dnl wxWidgets checks. @@ -191,4 +202,5 @@ AC_MSG_NOTICE([ Klatt: ${have_klatt} MBROLA: ${have_mbrola} + Sonic: ${have_sonic} ]) diff --git a/src/sonic.cpp b/src/sonic.cpp index 82febba5..99252d09 100644 --- a/src/sonic.cpp +++ b/src/sonic.cpp @@ -28,7 +28,6 @@ #include "speech.h" #include "sonic.h" -#ifdef INCLUDE_SONIC struct sonicStreamStruct { short *inputBuffer; @@ -969,4 +968,3 @@ int sonicChangeShortSpeed( sonicDestroyStream(stream); return numSamples; } -#endif // INCLUDE_SONIC diff --git a/src/speech.h b/src/speech.h index 5cb82cac..60c045aa 100644 --- a/src/speech.h +++ b/src/speech.h @@ -23,9 +23,6 @@ #include -// conditional compilation options -#define INCLUDE_SONIC - #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN #define ARCH_BIG #endif