Merge branch 'master' into android

This commit is contained in:
Reece H. Dunn
2013-09-16 12:26:33 +01:00
10 changed files with 103 additions and 46 deletions
+28 -9
View File
@@ -55,17 +55,15 @@ libespeak_includedir = $(includedir)/espeak
libespeak_include_HEADERS = \
src/speak_lib.h
common_FLAGS =
common_SOURCE = \
src/compiledict.cpp \
src/dictionary.cpp \
src/intonation.cpp \
src/klatt.cpp \
src/mbrowrap.cpp \
src/numbers.cpp \
src/readclause.cpp \
src/phonemelist.cpp \
src/setlengths.cpp \
src/sonic.cpp \
src/synthdata.cpp \
src/synthesize.cpp \
src/synth_mbrola.cpp \
@@ -74,11 +72,9 @@ common_SOURCE = \
src/voices.cpp \
src/wavegen.cpp
libespeak_FLAGS =
libespeak_SOURCE = \
src/speak_lib.cpp \
src/espeak_command.cpp \
src/event.cpp \
src/fifo.cpp \
src/debug.cpp
espeakedit_SOURCE = \
@@ -96,6 +92,29 @@ espeakedit_SOURCE = \
src/voicedlg.cpp \
src/vowelchart.cpp
if OPT_KLATT
common_FLAGS += -DINCLUDE_KLATT
common_SOURCE += src/klatt.cpp
endif
if OPT_MBROLA
common_FLAGS += -DINCLUDE_MBROLA
common_SOURCE += src/mbrowrap.cpp
endif
if OPT_SONIC
common_FLAGS += -DINCLUDE_SONIC
common_SOURCE += src/sonic.cpp
endif
if OPT_ASYNC
libespeak_FLAGS += -DUSE_ASYNC
libespeak_SOURCE += \
src/espeak_command.cpp \
src/event.cpp \
src/fifo.cpp
endif
if AUDIO_RUNTIME
wave_SOURCE = src/wave.cpp src/wave_pulse.cpp
wave_LIBS = -lpulse -lpulse-simple -lportaudio
@@ -127,7 +146,7 @@ docs/speak_lib.h: src/speak_lib.h
lib_LTLIBRARIES += src/libespeak.la
src_libespeak_la_LDFLAGS = -version-info $(SHARED_VERSION) $(wave_LIBS) -lpthread
src_libespeak_la_CXXFLAGS = $(wave_FLAGS) \
src_libespeak_la_CXXFLAGS = $(common_FLAGS) $(libespeak_FLAGS) $(wave_FLAGS) \
-fpic -fvisibility=hidden -D LIBRARY \
-pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\"
src_libespeak_la_SOURCES = $(common_SOURCE) $(libespeak_SOURCE) $(wave_SOURCE)
@@ -135,7 +154,7 @@ src_libespeak_la_SOURCES = $(common_SOURCE) $(libespeak_SOURCE) $(wave_SOURCE)
bin_PROGRAMS += src/speak
src_speak_LDFLAGS = $(wave_LIBS) -lpthread
src_speak_CXXFLAGS = $(wave_FLAGS)
src_speak_CXXFLAGS = $(common_FLAGS) $(wave_FLAGS)
src_speak_SOURCES = src/speak.cpp $(common_SOURCE) $(wave_SOURCE)
bin_PROGRAMS += src/espeak
@@ -146,7 +165,7 @@ src_espeak_SOURCES = src/espeak.cpp
bin_PROGRAMS += src/espeakedit
src_espeakedit_LDFLAGS = $(wave_LIBS) ${WX_LIBS}
src_espeakedit_CXXFLAGS = ${WX_CXXFLAGS} $(wave_FLAGS) \
src_espeakedit_CXXFLAGS = ${WX_CXXFLAGS} $(common_FLAGS) $(libespeak_FLAGS) $(wave_FLAGS) \
-D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT
src_espeakedit_SOURCES = $(common_SOURCE) $(libespeak_SOURCE) $(espeakedit_SOURCE) $(wave_SOURCE)
+54
View File
@@ -129,6 +129,55 @@ AM_CONDITIONAL(AUDIO_PULSEAUDIO, [test x"$AUDIO" = xpulseaudio])
AM_CONDITIONAL(AUDIO_PORTAUDIO, [test x"$AUDIO" = xportaudio])
AM_CONDITIONAL(AUDIO_SADA, [test x"$AUDIO" = xsada])
dnl ================================================================
dnl Optional compilation checks.
dnl ================================================================
AC_ARG_WITH([klatt],
[AS_HELP_STRING([--with-klatt], [enable the Klatt formant synthesizer @<:@default=yes@:>@])],
[])
if test "$with_klatt" = "no" ; then
have_klatt=no
else
have_klatt=yes
fi
AC_ARG_WITH([mbrola],
[AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])],
[])
if test "$with_mbrola" = "no" ; then
have_mbrola=no
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
AC_ARG_WITH([async],
[AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
[])
if test "$with_async" = "no" ; then
have_async=no
else
have_async=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])
AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
dnl ================================================================
dnl wxWidgets checks.
dnl ================================================================
@@ -166,4 +215,9 @@ AC_MSG_NOTICE([
portaudio: ${have_portaudio}
sada: ${have_sada}
audio configuration: ${AUDIO}
Klatt: ${have_klatt}
MBROLA: ${have_mbrola}
Sonic: ${have_sonic}
Async: ${have_async}
])
+2 -4
View File
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2013 Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -16,11 +17,10 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "speech.h"
#ifdef USE_ASYNC
// This source file is only used for asynchronious modes
#include "speech.h"
#include "espeak_command.h"
#include <stdlib.h>
#include <string.h>
@@ -702,6 +702,4 @@ void display_espeak_command( t_espeak_command* the_command)
}
#endif
}
#endif
//>
+2 -6
View File
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2013 Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,9 +18,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "speech.h"
#ifdef USE_ASYNC
// This source file is only used for asynchronious modes
@@ -33,6 +31,7 @@
#include <sys/time.h>
#include <errno.h>
#include "speech.h"
#include "speak_lib.h"
#include "event.h"
#include "wave.h"
@@ -723,7 +722,4 @@ ENTER("event_terminate");
init(); // purge event
}
}
#endif
//>
+2 -6
View File
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2013 Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -16,12 +17,9 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "speech.h"
#ifdef USE_ASYNC
// This source file is only used for asynchronious modes
//<includes
#include <unistd.h>
@@ -35,6 +33,7 @@
#include <sys/time.h>
#include <time.h>
#include "speech.h"
#include "fifo.h"
#include "wave.h"
#include "debug.h"
@@ -601,7 +600,4 @@ void fifo_terminate()
init(0); // purge fifo
}
#endif
//>
+1 -5
View File
@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2008 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* Copyright (C) 2013 Reece H. Dunn *
* *
* Based on a re-implementation by: *
* (c) 1993,94 Jon Iles and Nick Ing-Simmons *
@@ -38,8 +38,6 @@
#include "synthesize.h"
#include "voice.h"
#ifdef INCLUDE_KLATT // conditional compilation for the whole file
extern unsigned char *out_ptr; // **JSD
extern unsigned char *out_start;
extern unsigned char *out_end;
@@ -1409,5 +1407,3 @@ for(ix=0; ix<256; ix++)
kt_frame.AVpdb = 0;
kt_frame.Gain0 = 62; // 60
} // end of KlattInit
#endif // INCLUDE_KLATT
+1 -3
View File
@@ -3,6 +3,7 @@
* providing a subset of the API from the Windows mbrola DLL.
*
* Copyright (C) 2010 by Nicolas Pitre <nico@fluxnic.net>
* Copyright (C) 2013 Reece H. Dunn
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +17,6 @@
*/
#include "speech.h"
#ifdef INCLUDE_MBROLA
#include <stdarg.h>
#include <stdio.h>
@@ -609,5 +609,3 @@ void resetError_MBR(void)
{
mbr_errorbuf[0] = 0;
}
#endif // INCLUDE_MBROLA
-2
View File
@@ -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
+12 -1
View File
@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* Copyright (C) 2013 Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -35,13 +36,15 @@
#define MAX_HARMONIC 400 // 400 * 50Hz = 20 kHz, more than enough
#ifdef INCLUDE_KLATT
extern void SetSynth_Klatt(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v, int control);
extern int Wavegen_Klatt(int resume);
extern void KlattReset(int control);
#endif
extern void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v);
extern int Wavegen();
extern void CloseWaveFile2();
extern void KlattReset(int control);
extern FILE *f_wave;
static int frame_width;
@@ -115,9 +118,11 @@ void MakeWaveFile(int synthesis_method)
out_ptr = out_start = wav_outbuf;
out_end = &wav_outbuf[sizeof(wav_outbuf)];
#ifdef INCLUDE_KLATT
if(synthesis_method == 1)
result = Wavegen_Klatt(resume);
else
#endif
result = Wavegen();
if(f_wave != NULL)
@@ -972,7 +977,9 @@ static void SetSynth_mS(int length_mS, SpectFrame *sp1, SpectFrame *sp2, peak_t
if(voice->klattv[0])
{
#ifdef INCLUDE_KLATT
SetSynth_Klatt((length_mS * samplerate) / 1000, 0, &fr1, &fr2, voice, control); // convert mS to samples
#endif
}
else
{
@@ -1004,7 +1011,9 @@ void SpectSeq::MakeWave(int start, int end, PitchEnvelope &pitch)
if(voice->klattv[0])
{
synthesizer_type = 1;
#ifdef INCLUDE_KLATT
KlattReset(2);
#endif
}
SpeakNextClause(NULL,NULL,2); // stop speaking file
@@ -1120,7 +1129,9 @@ void SpectFrame::MakeWaveF(int control, PitchEnvelope &pitche, int amplitude, in
if(voice->klattv[0])
{
synthesizer_type = 1;
#ifdef INCLUDE_KLATT
KlattReset(2);
#endif
}
SpeakNextClause(NULL,NULL,2); // stop speaking file
+1 -10
View File
@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* Copyright (C) 2013 Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -22,11 +23,6 @@
#include <sys/types.h>
// conditional compilation options
#define INCLUDE_KLATT
#define INCLUDE_MBROLA
#define INCLUDE_SONIC
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
#define ARCH_BIG
#endif
@@ -46,12 +42,7 @@
#define __cdecl
//#define ESPEAK_API extern "C"
#ifdef LIBRARY
#define USE_ASYNC
#endif
#ifdef _ESPEAKEDIT
#define USE_ASYNC
#define LOG_FRAMES // write keyframe info to log-espeakedit
#endif