mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-09 07:52:27 +00:00
Create an espeak-ng version of espeak_Key.
This commit is contained in:
@@ -62,6 +62,9 @@ espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE output_mode,
|
||||
ESPEAK_NG_API int
|
||||
espeak_ng_GetSampleRate(void);
|
||||
|
||||
ESPEAK_NG_API espeak_ng_STATUS
|
||||
espeak_ng_SpeakKeyName(const char *key_name);
|
||||
|
||||
ESPEAK_NG_API espeak_ng_STATUS
|
||||
espeak_ng_SpeakCharacter(wchar_t character);
|
||||
|
||||
|
||||
@@ -80,6 +80,11 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output_type, int buf_length
|
||||
return espeak_ng_GetSampleRate();
|
||||
}
|
||||
|
||||
ESPEAK_API espeak_ERROR espeak_Key(const char *key_name)
|
||||
{
|
||||
return status_to_espeak_error(espeak_ng_SpeakKeyName(key_name));
|
||||
}
|
||||
|
||||
ESPEAK_API espeak_ERROR espeak_Char(wchar_t character)
|
||||
{
|
||||
return status_to_espeak_error(espeak_ng_SpeakCharacter(character));
|
||||
|
||||
+10
-12
@@ -733,27 +733,25 @@ ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text, size_t size,
|
||||
return a_error;
|
||||
}
|
||||
|
||||
ESPEAK_API espeak_ERROR espeak_Key(const char *key)
|
||||
ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SpeakKeyName(const char *key_name)
|
||||
{
|
||||
// symbolic name, symbolicname_character - is there a system resource of symbolicnames per language
|
||||
|
||||
if (f_logespeak)
|
||||
fprintf(f_logespeak, "\nKEY %s\n", key);
|
||||
|
||||
espeak_ERROR a_error = EE_OK;
|
||||
|
||||
if (my_mode & ENOUTPUT_MODE_SYNCHRONOUS) {
|
||||
sync_espeak_Key(key);
|
||||
return EE_OK;
|
||||
sync_espeak_Key(key_name);
|
||||
return ENS_OK;
|
||||
}
|
||||
|
||||
#ifdef USE_ASYNC
|
||||
t_espeak_command *c = create_espeak_key(key, NULL);
|
||||
a_error = status_to_espeak_error(fifo_add_command(c));
|
||||
if (a_error != EE_OK)
|
||||
t_espeak_command *c = create_espeak_key(key_name, NULL);
|
||||
espeak_ng_STATUS status = fifo_add_command(c);
|
||||
if (status != ENS_OK)
|
||||
delete_espeak_command(c);
|
||||
return status;
|
||||
#else
|
||||
sync_espeak_Key(key_name);
|
||||
return ENS_OK;
|
||||
#endif
|
||||
return a_error;
|
||||
}
|
||||
|
||||
ESPEAK_NG_API espeak_ng_STATUS espeak_ng_SpeakCharacter(wchar_t character)
|
||||
|
||||
Reference in New Issue
Block a user