Skip to content

Commit

Permalink
build: fix duplicated symbol when linking
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkie committed Jun 15, 2017
1 parent f946c6e commit 949de3f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
15 changes: 12 additions & 3 deletions src/libespeak-ng/mbrowrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,23 @@
*/

#include "config.h"
#include "mbrowrap.h"

int (WINAPI *init_MBR)(char *voice_path);
void (WINAPI *close_MBR)(void);
void (WINAPI *reset_MBR)(void);
int (WINAPI *read_MBR)(short *buffer, int nb_samples);
int (WINAPI *write_MBR)(char *data);
int (WINAPI *flush_MBR)(void);
int (WINAPI *getFreq_MBR)(void);
void (WINAPI *setVolumeRatio_MBR)(float value);
char * (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize);
void (WINAPI *setNoError_MBR)(int no_error);

#if defined(_WIN32) || defined(_WIN64)

#include <windows.h>

#include "mbrowrap.h"

HINSTANCE hinstDllMBR = NULL;

Expand Down Expand Up @@ -69,8 +80,6 @@ void unload_MBR()
#include <unistd.h>

#include <espeak-ng/espeak_ng.h>

#include "mbrowrap.h"
#include "speech.h"

/*
Expand Down
20 changes: 10 additions & 10 deletions src/libespeak-ng/mbrowrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,66 +37,66 @@ typedef int BOOL;
* error reason. If this is successful, then close_MBR() must be called
* before init_MBR() can be called again.
*/
int (WINAPI *init_MBR)(char *voice_path);
extern int (WINAPI *init_MBR)(char *voice_path);

/*
* Stop mbrola and release any resources. It is necessary to call
* this after a successful call to init_MBR() before init_MBR() can be
* called again.
*/
void (WINAPI *close_MBR)(void);
extern void (WINAPI *close_MBR)(void);

/*
* Stop any ongoing processing and flush all buffers. After this call
* any synthesis request will start afresh.
*/
void (WINAPI *reset_MBR)(void);
extern void (WINAPI *reset_MBR)(void);

/*
* Return at most 'nb_samples' audio samples into 'buffer'. The returned
* value is the actual number of samples returned, or -1 on error.
* If not successful, lastErrorStr_MBR() will provide the error reason.
* Samples are always 16-bit little endian.
*/
int (WINAPI *read_MBR)(short *buffer, int nb_samples);
extern int (WINAPI *read_MBR)(short *buffer, int nb_samples);

/*
* Write a NULL terminated string of phoneme in the input buffer.
* Return the number of chars actually written, or -1 on error.
* If not successful, lastErrorStr_MBR() will provide the error reason.
*/
int (WINAPI *write_MBR)(char *data);
extern int (WINAPI *write_MBR)(char *data);

/*
* Send a flush command to the mbrola input stream.
* This is currently similar to write_MBR("#\n"). Return 1 on success
* or 0 on failure. If not successful, lastErrorStr_MBR() will provide
* the error reason.
*/
int (WINAPI *flush_MBR)(void);
extern int (WINAPI *flush_MBR)(void);

/*
* Return the audio sample frequency of the used voice database.
*/
int (WINAPI *getFreq_MBR)(void);
extern int (WINAPI *getFreq_MBR)(void);

/*
* Overall volume.
*/
void (WINAPI *setVolumeRatio_MBR)(float value);
extern void (WINAPI *setVolumeRatio_MBR)(float value);

/*
* Copy into 'buffer' at most 'bufsize' bytes from the latest error
* message. This may also contain non-fatal errors from mbrola. When
* no error message is pending then an empty string is returned.
* Consecutive calls to lastErrorStr_MBR() will return the same message.
*/
char * (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize);
extern char * (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize);

/*
* Tolerance to missing diphones.
*/
void (WINAPI *setNoError_MBR)(int no_error);
extern void (WINAPI *setNoError_MBR)(int no_error);

BOOL load_MBR(void);
void unload_MBR(void);
Expand Down

0 comments on commit 949de3f

Please sign in to comment.