mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-05 06:45:39 +00:00
[1.39.42]
Languages which use non-Latin alphabets will automatically speak a word of Latin characters as English (or another specified language) without the need for entries in its *_rules file. synthesize.cpp, SynthOnTimer(): Ensure the sound channel is open if there items still to be spoken, to prevent sound output lock-up. Reduce warning messages from compilers. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@211 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+21
-7
@@ -74,11 +74,12 @@ static int dispatch_audio(short* outbuf, int length, espeak_EVENT* event)
|
||||
|
||||
int a_wave_can_be_played = fifo_is_command_enabled();
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
SHOW("*** dispatch_audio > uid=%d, [write=%p (%d bytes)], sample=%d, a_wave_can_be_played = %d\n",
|
||||
(event) ? event->unique_identifier : 0, wave_test_get_write_buffer(), 2*length,
|
||||
(event) ? event->sample : 0,
|
||||
a_wave_can_be_played);
|
||||
|
||||
#endif
|
||||
|
||||
switch(my_mode)
|
||||
{
|
||||
@@ -156,11 +157,14 @@ static int create_events(short* outbuf, int length, espeak_EVENT* event, uint32_
|
||||
else
|
||||
{
|
||||
event = event_list + i;
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
SHOW("Synthesize: event->sample(%d) + %d = %d\n", event->sample, the_write_pos, event->sample + the_write_pos);
|
||||
#endif
|
||||
event->sample += the_write_pos;
|
||||
}
|
||||
#ifdef DEBUG_ENABLED
|
||||
SHOW("*** Synthesize: i=%d (event_list_ix=%d), length=%d\n",i,event_list_ix,length);
|
||||
#endif
|
||||
finished = dispatch_audio((short *)outbuf, length, event);
|
||||
length = 0; // the wave data are played once.
|
||||
i++;
|
||||
@@ -365,7 +369,6 @@ static int initialise(void)
|
||||
static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text, int flags)
|
||||
{//========================================================================================
|
||||
// Fill the buffer with output sound
|
||||
ENTER("Synthesize");
|
||||
int length;
|
||||
int finished = 0;
|
||||
int count_buffers = 0;
|
||||
@@ -374,6 +377,7 @@ static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text,
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
ENTER("Synthesize");
|
||||
if (text)
|
||||
{
|
||||
SHOW("Synthesize > uid=%d, flags=%d, >>>text=%s<<<\n", unique_identifier, flags, text);
|
||||
@@ -429,7 +433,9 @@ static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text,
|
||||
|
||||
for(;;)
|
||||
{
|
||||
#ifdef DEBUG_ENABLED
|
||||
SHOW("Synthesize > %s\n","for (next)");
|
||||
#endif
|
||||
out_ptr = outbuf;
|
||||
out_end = &outbuf[outbuf_size];
|
||||
event_list_ix = 0;
|
||||
@@ -524,11 +530,13 @@ void MarkerEvent(int type, unsigned int char_position, int value, unsigned char
|
||||
ep->audio_position = int(time);
|
||||
ep->sample = (count_samples + mbrola_delay + (out_ptr - out_start)/2);
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
SHOW("MarkerEvent > count_samples=%d, out_ptr=%x, out_start=0x%x\n",count_samples, out_ptr, out_start);
|
||||
SHOW("*** MarkerEvent > type=%s, uid=%d, text_pos=%d, length=%d, audio_position=%d, sample=%d\n",
|
||||
label[ep->type], ep->unique_identifier, ep->text_position, ep->length,
|
||||
ep->audio_position, ep->sample);
|
||||
|
||||
#endif
|
||||
|
||||
if((type == espeakEVENT_MARK) || (type == espeakEVENT_PLAY))
|
||||
ep->id.name = &namedata[value];
|
||||
else
|
||||
@@ -542,11 +550,13 @@ espeak_ERROR sync_espeak_Synth(unsigned int unique_identifier, const void *text,
|
||||
unsigned int position, espeak_POSITION_TYPE position_type,
|
||||
unsigned int end_position, unsigned int flags, void* user_data)
|
||||
{//===========================================================================
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
ENTER("sync_espeak_Synth");
|
||||
|
||||
SHOW("sync_espeak_Synth > position=%d, position_type=%d, end_position=%d, flags=%d, user_data=0x%x, text=%s\n", position, position_type, end_position, flags, user_data, text);
|
||||
|
||||
espeak_ERROR aStatus;
|
||||
#endif
|
||||
|
||||
espeak_ERROR aStatus;
|
||||
|
||||
InitText(flags);
|
||||
my_unique_identifier = unique_identifier;
|
||||
@@ -748,8 +758,10 @@ ESPEAK_API espeak_ERROR espeak_Synth(const void *text, size_t size,
|
||||
unsigned int end_position, unsigned int flags,
|
||||
unsigned int* unique_identifier, void* user_data)
|
||||
{//=====================================================================================
|
||||
#ifdef DEBUG_ENABLED
|
||||
ENTER("espeak_Synth");
|
||||
SHOW("espeak_Synth > position=%d, position_type=%d, end_position=%d, flags=%d, user_data=0x%x, text=%s\n", position, position_type, end_position, flags, user_data, text);
|
||||
#endif
|
||||
|
||||
espeak_ERROR a_error=EE_INTERNAL_ERROR;
|
||||
static unsigned int temp_identifier;
|
||||
@@ -805,8 +817,10 @@ ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text, size_t size,
|
||||
unsigned int* unique_identifier,
|
||||
void* user_data)
|
||||
{//=========================================================================
|
||||
#ifdef DEBUG_ENABLED
|
||||
ENTER("espeak_Synth_Mark");
|
||||
SHOW("espeak_Synth_Mark > index_mark=%s, end_position=%d, flags=%d, text=%s\n", index_mark, end_position, flags, text);
|
||||
#endif
|
||||
|
||||
espeak_ERROR a_error=EE_OK;
|
||||
static unsigned int temp_identifier;
|
||||
|
||||
Reference in New Issue
Block a user