|
|
|
|
|
|
|
|
/* An implementation of the eSpeak API using the espeak-ng API. |
|
|
/* An implementation of the eSpeak API using the espeak-ng API. |
|
|
* |
|
|
* |
|
|
|
|
|
* Copyright (C) 2005 to 2013 by Jonathan Duddington |
|
|
|
|
|
* email: [email protected] |
|
|
* Copyright (C) 2016 Reece H. Dunn |
|
|
* Copyright (C) 2016 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 |
|
|
|
|
|
|
|
|
#include "synthesize.h" |
|
|
#include "synthesize.h" |
|
|
#include "translate.h" |
|
|
#include "translate.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "event.h" |
|
|
|
|
|
|
|
|
static espeak_ERROR status_to_espeak_error(espeak_ng_STATUS status) |
|
|
static espeak_ERROR status_to_espeak_error(espeak_ng_STATUS status) |
|
|
{ |
|
|
{ |
|
|
switch (status) |
|
|
switch (status) |
|
|
|
|
|
|
|
|
return espeak_ng_GetSampleRate(); |
|
|
return espeak_ng_GetSampleRate(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ESPEAK_API void espeak_SetSynthCallback(t_espeak_callback *SynthCallback) |
|
|
|
|
|
{ |
|
|
|
|
|
synth_callback = SynthCallback; |
|
|
|
|
|
#ifdef USE_ASYNC |
|
|
|
|
|
event_set_callback(synth_callback); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ESPEAK_API void espeak_SetUriCallback(int (*UriCallback)(int, const char *, const char *)) |
|
|
|
|
|
{ |
|
|
|
|
|
uri_callback = UriCallback; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ESPEAK_API void espeak_SetPhonemeCallback(int (*PhonemeCallback)(const char *)) |
|
|
|
|
|
{ |
|
|
|
|
|
phoneme_callback = PhonemeCallback; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ESPEAK_API espeak_ERROR espeak_Key(const char *key_name) |
|
|
ESPEAK_API espeak_ERROR espeak_Key(const char *key_name) |
|
|
{ |
|
|
{ |
|
|
return status_to_espeak_error(espeak_ng_SpeakKeyName(key_name)); |
|
|
return status_to_espeak_error(espeak_ng_SpeakKeyName(key_name)); |