Browse Source

Move the espeak callback APIs to espeak_api.c.

master
Reece H. Dunn 9 years ago
parent
commit
5e42051a30
2 changed files with 22 additions and 18 deletions
  1. 22
    0
      src/libespeak-ng/espeak_api.c
  2. 0
    18
      src/libespeak-ng/speech.c

+ 22
- 0
src/libespeak-ng/espeak_api.c View File

/* 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));

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



#pragma GCC visibility push(default) #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, ESPEAK_API espeak_ERROR espeak_Synth(const void *text, size_t size,
unsigned int position, unsigned int position,
espeak_POSITION_TYPE position_type, espeak_POSITION_TYPE position_type,

Loading…
Cancel
Save