Use the C compiler to build C files; restructuring.

This moves the libespeak source (*.cpp) files to src/libespeak-ng
and renames the C files (libespeak, espeak, speak) so they have
a .c file extension.
This commit is contained in:
Reece H. Dunn
2015-12-09 23:33:00 +00:00
parent 1e01ce9202
commit f7dfc38dd7
34 changed files with 70 additions and 54 deletions
+2
View File
@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2006 to 2013 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* Copyright (C) 2015 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,6 +18,7 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+5 -5
View File
@@ -11,7 +11,7 @@ extern "C"
{
#endif
enum t_espeak_type
typedef enum
{
ET_TEXT,
ET_MARK,
@@ -22,7 +22,7 @@ enum t_espeak_type
ET_VOICE_NAME,
ET_VOICE_SPEC,
ET_TERMINATED_MSG
};
} t_espeak_type;
typedef struct
{
@@ -76,16 +76,16 @@ typedef struct
int relative;
} t_espeak_parameter;
enum t_command_state
typedef enum
{
CS_UNDEFINED, // The command has just been created
CS_PENDING, // stored in the fifo
CS_PROCESSED // processed
};
} t_command_state;
typedef struct
{
enum t_espeak_type type;
t_espeak_type type;
t_command_state state;
union command
+2 -2
View File
@@ -37,7 +37,7 @@
#include "options.h"
extern char word_phonemes[N_WORD_PHONEMES]; // a word translated into phoneme codes
extern int __cdecl string_sorter(char **a, char **b);
extern "C" int __cdecl string_sorter(char **a, char **b);
//******************************************************************************************************
@@ -1470,7 +1470,7 @@ void CompareLexicon(int id)
//******************************************************************************************************
extern int HashDictionary(const char *string);
extern "C" int HashDictionary(const char *string);
static int n_words;
struct wcount {
+4 -3
View File
@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2013 Reece H. Dunn *
* Copyright (C) 2013-2015 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 *
@@ -32,6 +32,7 @@
#include <semaphore.h>
#include <sys/time.h>
#include <errno.h>
#include <stdbool.h>
#include "speech.h"
#include "speak_lib.h"
@@ -63,7 +64,7 @@ enum {MIN_TIMEOUT_IN_MS=10,
typedef struct t_node
{
void* data;
t_node *next;
struct t_node *next;
} node;
static node* head=NULL;
@@ -474,7 +475,7 @@ ENTER("get_remaining_time");
//>
//<polling_thread
static void* polling_thread(void*)
static void* polling_thread(void*p)
{
ENTER("polling_thread");
+3 -3
View File
@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2013 Reece H. Dunn *
* Copyright (C) 2013-2015 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 *
@@ -376,7 +376,7 @@ static void close_stream()
//>
//<say_thread
static void* say_thread(void*)
static void* say_thread(void*p)
{
ENTER("say_thread");
@@ -489,7 +489,7 @@ int fifo_is_command_enabled()
typedef struct t_node
{
t_espeak_command* data;
t_node *next;
struct t_node *next;
} node;
static node* head=NULL;
@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdbool.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
@@ -580,8 +580,8 @@ void MarkerEvent(int type, unsigned int char_position, int value, int value2, un
ep->text_position = char_position & 0xffffff;
ep->length = char_position >> 24;
time = (double(count_samples + mbrola_delay + (out_ptr - out_start)/2)*1000.0)/samplerate;
ep->audio_position = int(time);
time = ((double)(count_samples + mbrola_delay + (out_ptr - out_start)/2)*1000.0)/samplerate;
ep->audio_position = (int)time;
ep->sample = (count_samples + mbrola_delay + (out_ptr - out_start)/2);
#ifdef DEBUG_ENABLED
@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+2
View File
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2015 by Reece H. Dunn *
* based on AudioIO.cc (Audacity-1.2.4b) and wavegen.cpp *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -23,6 +24,7 @@
#ifdef USE_ASYNC
// This source file is only used for asynchronious modes
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2007, Gilles Casse <gcasse@oralux.org> *
* Copyright (C) 2015 by Reece H. Dunn *
* eSpeak driver for PulseAudio *
* based on the XMMS PulseAudio Plugin *
* *
@@ -29,6 +30,7 @@
#ifdef USE_ASYNC
// This source file is only used for asynchronious modes
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+1
View File
@@ -20,6 +20,7 @@
#include "speech.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+1 -1
View File
@@ -34,7 +34,7 @@
#include "wx/datstrm.h"
extern int PeaksToHarmspect(wavegen_peaks_t *peaks, int pitch, int *htab, int control);
extern "C" int PeaksToHarmspect(wavegen_peaks_t *peaks, int pitch, int *htab, int control);
extern unsigned char pk_shape1[];
extern int pk_select;
+2 -2
View File
@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* Copyright (C) 2013 by Reece H. Dunn *
* Copyright (C) 2013-2015 by 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 *
@@ -384,7 +384,7 @@ extern SpectDisplay *currentcanvas;
extern float polint(float xa[],float ya[],int n,float x);
extern void WavegenInit(int samplerate, int wavemult_fact);
extern void WavegenInitPkData(int); // initialise envelope data
extern void SetPitch(int length, unsigned char *env, int pitch1, int pitch2);
extern "C" void SetPitch(int length, unsigned char *env, int pitch1, int pitch2);
extern void SetSynthHtab(int length_mS, USHORT *ht1, int nh1, float pitch1, USHORT *ht2, int nh2, float pitch2);
extern void MakeWaveFile(int synthesis_method);
extern void MakeWaveBuf(int length, UCHAR *buf);
+4 -4
View File
@@ -37,13 +37,13 @@
#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 "C" void SetSynth_Klatt(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v, int control);
extern "C" 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 "C" void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v);
extern "C" int Wavegen();
extern void CloseWaveFile2();
extern FILE *f_wave;