mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-19 02:57:05 +00:00
Return ENS_SPEECH_STOPPED from Synthesize when the speech callback returns >1 to stop the audio.
This commit is contained in:
@@ -55,6 +55,7 @@ typedef enum {
|
||||
ENS_UNSUPPORTED_PHON_FORMAT = 0x10000BFF,
|
||||
ENS_NO_SPECT_FRAMES = 0x10000CFF,
|
||||
ENS_EMPTY_PHONEME_MANIFEST = 0x10000DFF,
|
||||
ENS_SPEECH_STOPPED = 0x10000EFF,
|
||||
} espeak_ng_STATUS;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -37,6 +37,7 @@ static espeak_ERROR status_to_espeak_error(espeak_ng_STATUS status)
|
||||
switch (status)
|
||||
{
|
||||
case ENS_OK: return EE_OK;
|
||||
case ENS_SPEECH_STOPPED: return EE_OK;
|
||||
case ENS_VOICE_NOT_FOUND: return EE_NOT_FOUND;
|
||||
case ENS_MBROLA_NOT_FOUND: return EE_NOT_FOUND;
|
||||
case ENS_MBROLA_VOICE_NOT_FOUND: return EE_NOT_FOUND;
|
||||
|
||||
@@ -410,7 +410,7 @@ static espeak_ng_STATUS Synthesize(unsigned int unique_identifier, const void *t
|
||||
finished = synth_callback((short *)outbuf, length, event_list);
|
||||
if (finished) {
|
||||
SpeakNextClause(NULL, 0, 2); // stop
|
||||
break;
|
||||
return ENS_SPEECH_STOPPED;
|
||||
}
|
||||
|
||||
if (Generate(phoneme_list, &n_phoneme_list, 1) == 0) {
|
||||
@@ -428,12 +428,11 @@ static espeak_ng_STATUS Synthesize(unsigned int unique_identifier, const void *t
|
||||
return ENS_AUDIO_ERROR;
|
||||
} else if (synth_callback)
|
||||
synth_callback(NULL, 0, event_list); // NULL buffer ptr indicates end of data
|
||||
break;
|
||||
return ENS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ENS_OK;
|
||||
}
|
||||
|
||||
void MarkerEvent(int type, unsigned int char_position, int value, int value2, unsigned char *out_ptr)
|
||||
|
||||
Reference in New Issue
Block a user