Browse Source

Use C linkage for all libespeak internal headers.

The libespeak files are supposed to be C code, so use C linkage
for all the functions defined in that code when they are being
referenced in the C++ code (i.e. espeakedit).
master
Reece H. Dunn 9 years ago
parent
commit
1e01ce9202
14 changed files with 110 additions and 6 deletions
  1. 2
    2
      src/compiledata.cpp
  2. 8
    0
      src/debug.h
  3. 9
    0
      src/espeak_command.h
  4. 9
    0
      src/event.h
  5. 9
    0
      src/fifo.h
  6. 7
    1
      src/klatt.h
  7. 2
    2
      src/options.cpp
  8. 9
    0
      src/phoneme.h
  9. 9
    0
      src/sintab.h
  10. 10
    1
      src/speech.h
  11. 9
    0
      src/synthesize.h
  12. 9
    0
      src/translate.h
  13. 9
    0
      src/voice.h
  14. 9
    0
      src/wave.h

+ 2
- 2
src/compiledata.cpp View File



extern void FindPhonemesUsed(void); extern void FindPhonemesUsed(void);
extern void DisplayErrorFile(const char *fname); extern void DisplayErrorFile(const char *fname);
extern int utf8_in(int *c, const char *buf);
extern int utf8_out(unsigned int c, char *buf);
extern "C" int utf8_in(int *c, const char *buf);
extern "C" int utf8_out(unsigned int c, char *buf);
extern void DrawEnvelopes(); extern void DrawEnvelopes();
extern void ReadPhondataManifest(); extern void ReadPhondataManifest();
char path_source[sizeof(path_home)+20]; char path_source[sizeof(path_home)+20];

+ 8
- 0
src/debug.h View File

#ifndef DEBUG_H #ifndef DEBUG_H
#define DEBUG_H #define DEBUG_H


#ifdef __cplusplus
extern "C"
{
#endif

//#define DEBUG_ENABLED //#define DEBUG_ENABLED


#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
#define ENTER(text) #define ENTER(text)
#endif #endif


#ifdef __cplusplus
}
#endif


#endif #endif

+ 9
- 0
src/espeak_command.h View File

#endif #endif
#include "speak_lib.h" #include "speak_lib.h"


#ifdef __cplusplus
extern "C"
{
#endif

enum t_espeak_type enum t_espeak_type
{ {
ET_TEXT, ET_TEXT,


int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data); int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);


#ifdef __cplusplus
}
#endif

//> //>
#endif #endif

+ 9
- 0
src/event.h View File



#include "speak_lib.h" #include "speak_lib.h"


#ifdef __cplusplus
extern "C"
{
#endif

// Initialize the event component. // Initialize the event component.
// First function to be called. // First function to be called.
// the callback will be called when the event actually occurs. // the callback will be called when the event actually occurs.
// Last function to be called. // Last function to be called.
void event_terminate(); void event_terminate();


#ifdef __cplusplus
}
#endif

#endif #endif

+ 9
- 0
src/fifo.h View File

#include "espeak_command.h" #include "espeak_command.h"
#include "speak_lib.h" #include "speak_lib.h"


#ifdef __cplusplus
extern "C"
{
#endif

// Initialize the fifo component. // Initialize the fifo component.
// First function to be called. // First function to be called.
void fifo_init(); void fifo_init();
// Returns 1 if yes, or 0 otherwise. // Returns 1 if yes, or 0 otherwise.
int fifo_is_command_enabled(); int fifo_is_command_enabled();


#ifdef __cplusplus
}
#endif

#endif #endif

+ 7
- 1
src/klatt.h View File


#ifdef __cplusplus
extern "C"
{
#endif


#define CASCADE_PARALLEL 1 /* Type of synthesis model */ #define CASCADE_PARALLEL 1 /* Type of synthesis model */
#define ALL_PARALLEL 2 #define ALL_PARALLEL 2
} klatt_peaks_t; } klatt_peaks_t;




#ifdef __cplusplus
}
#endif

+ 2
- 2
src/options.cpp View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2013 by Jonathan Duddington * * Copyright (C) 2005 to 2013 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* 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 * * 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 * * it under the terms of the GNU General Public License as published by *


#include "options.h" #include "options.h"


extern void WavegenInit(int samplerate, int wavemult_fact);
extern "C" void WavegenInit(int samplerate, int wavemult_fact);
extern void strncpy0(char *to,const char *from, int size); extern void strncpy0(char *to,const char *from, int size);
extern int GetNumeric(wxTextCtrl *t); extern int GetNumeric(wxTextCtrl *t);
extern void SetNumeric(wxTextCtrl *t, int value); extern void SetNumeric(wxTextCtrl *t, int value);

+ 9
- 0
src/phoneme.h View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2010 by Jonathan Duddington * * Copyright (C) 2005 to 2010 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/


#ifdef __cplusplus
extern "C"
{
#endif




// phoneme types // phoneme types


extern PHONEME_TAB_LIST phoneme_tab_list[N_PHONEME_TABS]; extern PHONEME_TAB_LIST phoneme_tab_list[N_PHONEME_TABS];
extern int phoneme_tab_number; extern int phoneme_tab_number;

#ifdef __cplusplus
}
#endif

+ 9
- 0
src/sintab.h View File

#ifdef __cplusplus
extern "C"
{
#endif

short int sin_tab[2048] = { short int sin_tab[2048] = {
0, -25, -50, -75, -100, -125, -150, -175, 0, -25, -50, -75, -100, -125, -150, -175,
-201, -226, -251, -276, -301, -326, -351, -376, -201, -226, -251, -276, -301, -326, -351, -376,
401, 376, 351, 326, 301, 276, 251, 226, 401, 376, 351, 326, 301, 276, 251, 226,
201, 175, 150, 125, 100, 75, 50, 25, 201, 175, 150, 125, 100, 75, 50, 25,
}; };

#ifdef __cplusplus
}
#endif

+ 10
- 1
src/speech.h View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington * * Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* 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 * * 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 * * it under the terms of the GNU General Public License as published by *


#include <sys/types.h> #include <sys/types.h>


#ifdef __cplusplus
extern "C"
{
#endif

#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
#define ARCH_BIG #define ARCH_BIG
#endif #endif
char *Alloc(int size); char *Alloc(int size);
void Free(void *ptr); void Free(void *ptr);


#ifdef __cplusplus
}
#endif

#endif // SPEECH_H #endif // SPEECH_H

+ 9
- 0
src/synthesize.h View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2014 by Jonathan Duddington * * Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/


#ifdef __cplusplus
extern "C"
{
#endif

#define espeakINITIALIZE_PHONEME_IPA 0x0002 // move this to speak_lib.h, after eSpeak version 1.46.02 #define espeakINITIALIZE_PHONEME_IPA 0x0002 // move this to speak_lib.h, after eSpeak version 1.46.02




void KlattReset(int control); void KlattReset(int control);
int Wavegen_Klatt2(int length, int modulation, int resume, frame_t *fr1, frame_t *fr2); int Wavegen_Klatt2(int length, int modulation, int resume, frame_t *fr1, frame_t *fr2);


#ifdef __cplusplus
}
#endif

+ 9
- 0
src/translate.h View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2014 by Jonathan Duddington * * Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/


#ifdef __cplusplus
extern "C"
{
#endif


#define L(c1,c2) (c1<<8)+c2 // combine two characters into an integer for translator name #define L(c1,c2) (c1<<8)+c2 // combine two characters into an integer for translator name


extern FILE *f_trans; // for logging extern FILE *f_trans; // for logging
extern FILE *f_logespeak; extern FILE *f_logespeak;
extern int logging_type; // from config file extern int logging_type; // from config file

#ifdef __cplusplus
}
#endif

+ 9
- 0
src/voice.h View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington * * Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***************************************************************************/ ***************************************************************************/


#ifdef __cplusplus
extern "C"
{
#endif





typedef struct { typedef struct {
void ReadTonePoints(char *string, int *tone_pts); void ReadTonePoints(char *string, int *tone_pts);
void VoiceReset(int control); void VoiceReset(int control);


#ifdef __cplusplus
}
#endif

+ 9
- 0
src/wave.h View File

#include "stdint.h" #include "stdint.h"
#endif #endif


#ifdef __cplusplus
extern "C"
{
#endif

extern int option_device_number; extern int option_device_number;


extern int wave_init(int samplerate); extern int wave_init(int samplerate);
// for tests // for tests
extern void *wave_test_get_write_buffer(); extern void *wave_test_get_write_buffer();


#ifdef __cplusplus
}
#endif

#endif #endif

Loading…
Cancel
Save