Move the espeak callback APIs to espeak_api.c.

This commit is contained in:
Reece H. Dunn
2016-01-02 15:01:30 +00:00
parent 7d8d91698f
commit 5e42051a30
2 changed files with 22 additions and 18 deletions
+22
View File
@@ -1,5 +1,7 @@
/* An implementation of the eSpeak API using the espeak-ng API.
*
* Copyright (C) 2005 to 2013 by Jonathan Duddington
* email: jonsd@users.sourceforge.net
* Copyright (C) 2016 Reece H. Dunn
*
* This program is free software; you can redistribute it and/or modify
@@ -32,6 +34,8 @@
#include "synthesize.h"
#include "translate.h"
#include "event.h"
static espeak_ERROR status_to_espeak_error(espeak_ng_STATUS status)
{
switch (status)
@@ -80,6 +84,24 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output_type, int buf_length
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)
{
return status_to_espeak_error(espeak_ng_SpeakKeyName(key_name));
-18
View File
@@ -613,24 +613,6 @@ void sync_espeak_SetPunctuationList(const wchar_t *punctlist)
#pragma GCC visibility push(default)
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_Synth(const void *text, size_t size,
unsigned int position,
espeak_POSITION_TYPE position_type,