Browse Source

code cleanup: static phoneme_callback

master
Yury Popov 2 years ago
parent
commit
25c4dc150a
No account linked to committer's email address
3 changed files with 9 additions and 8 deletions
  1. 0
    6
      src/libespeak-ng/speech.c
  2. 9
    0
      src/libespeak-ng/synthesize.c
  3. 0
    2
      src/libespeak-ng/translate.h

+ 0
- 6
src/libespeak-ng/speech.c View File

static espeak_ng_STATUS err = ENS_OK; static espeak_ng_STATUS err = ENS_OK;


static t_espeak_callback *synth_callback = NULL; static t_espeak_callback *synth_callback = NULL;
int (*phoneme_callback)(const char *) = NULL;


char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory char path_home[N_PATH_HOME]; // this is the espeak-ng-data directory
extern int saved_parameters[N_SPEECH_PARAM]; // Parameters saved on synthesis start extern int saved_parameters[N_SPEECH_PARAM]; // Parameters saved on synthesis start
#endif #endif
} }


ESPEAK_API void espeak_SetPhonemeCallback(int (*PhonemeCallback)(const char *))
{
phoneme_callback = PhonemeCallback;
}

ESPEAK_NG_API espeak_ng_STATUS ESPEAK_NG_API espeak_ng_STATUS
espeak_ng_Synthesize(const void *text, size_t size, espeak_ng_Synthesize(const void *text, size_t size,
unsigned int position, unsigned int position,

+ 9
- 0
src/libespeak-ng/synthesize.c View File



static voice_t *new_voice = NULL; static voice_t *new_voice = NULL;


static int (*phoneme_callback)(const char *) = NULL;

#define RMS_GLOTTAL1 35 // vowel before glottal stop #define RMS_GLOTTAL1 35 // vowel before glottal stop
#define RMS_START 28 // 28 #define RMS_START 28 // 28
#define VOWEL_FRONT_LENGTH 50 #define VOWEL_FRONT_LENGTH 50


return 1; return 1;
} }

#pragma GCC visibility push(default)
ESPEAK_API void espeak_SetPhonemeCallback(int (*PhonemeCallback)(const char *))
{
phoneme_callback = PhonemeCallback;
}
#pragma GCC visibility pop

+ 0
- 2
src/libespeak-ng/translate.h View File

extern espeak_ng_TEXT_DECODER *p_decoder; extern espeak_ng_TEXT_DECODER *p_decoder;
extern int dictionary_skipwords; extern int dictionary_skipwords;


extern int (*phoneme_callback)(const char *);

#define LEADING_2_BITS 0xC0 // 0b11000000 #define LEADING_2_BITS 0xC0 // 0b11000000
#define UTF8_TAIL_BITS 0x80 // 0b10000000 #define UTF8_TAIL_BITS 0x80 // 0b10000000



Loading…
Cancel
Save