diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-04-29 19:19:37 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-04-29 19:20:28 (GMT) |
commit | cf98718ab15aa01a0238e0281d114a65e658104c (patch) | |
tree | f341400dfc7cea1b0d27247be179e1fa25a40c35 /src | |
parent | 5f40d8e8561a0a60fc8ab684360ed340779b860e (diff) |
Support utf-8 source strings #816
Diffstat (limited to 'src')
-rw-r--r-- | src/espeak.c | 20 | ||||
-rw-r--r-- | src/gstespeak.c | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/espeak.c b/src/espeak.c index 24e3765..51817ca 100644 --- a/src/espeak.c +++ b/src/espeak.c @@ -345,8 +345,9 @@ play(Econtext *self, Espin *spin, gsize size_to_play) spin->sound_offset += size_to_play; spin->events_pos += 1; - GST_DEBUG("out=%p size_to_play=%zd tell=%zd", GST_BUFFER_DATA(out), - size_to_play, spin->sound_offset); + GST_DEBUG("out=%p size_to_play=%zd tell=%zd ts=%zd dur=%zd", + GST_BUFFER_DATA(out), size_to_play, spin->sound_offset, + GST_BUFFER_TIMESTAMP(out), GST_BUFFER_DURATION(out)); return out; } @@ -380,8 +381,10 @@ espeak_out(Econtext *self, gsize size_to_play) Espin *spin = self->out; gsize spin_size = spin->sound->len; - GST_DEBUG("[%p] spin->sound_offset=%zd spin_size=%zd", - self, spin->sound_offset, spin_size); + GST_DEBUG("[%p] spin=%p spin->sound_offset=%zd spin_size=%zd " \ + "spin->state=%d", + self, spin, spin->sound_offset, spin_size, + g_atomic_int_get(&spin->state)); if (g_atomic_int_get(&spin->state) == PLAY && spin->sound_offset >= spin_size) @@ -503,8 +506,10 @@ synth(Econtext *self, Espin *spin) if (spin->events->len) { - self->text_offset = g_array_index(spin->events, - espeak_EVENT, spin->events->len-1).text_position + 1; + int text_offset = g_array_index(spin->events, espeak_EVENT, + spin->events->len-1).text_position + 1; + self->text_offset = g_utf8_offset_to_pointer(self->text, text_offset) + - self->text; } espeak_EVENT last_event = { espeakEVENT_LIST_TERMINATED }; @@ -593,6 +598,9 @@ process(gpointer data) continue; } + GST_DEBUG("[%p] context->text_offset=%d context->text_len=%d", + context, context->text_offset, context->text_len); + if (context->text_offset >= context->text_len) { GST_DEBUG("[%p] end of text to process", context); diff --git a/src/gstespeak.c b/src/gstespeak.c index a018efe..ed0f6c7 100644 --- a/src/gstespeak.c +++ b/src/gstespeak.c @@ -292,6 +292,7 @@ gst_espeak_create(GstBaseSrc * self_, guint64 offset, guint size, static gboolean gst_espeak_start(GstBaseSrc * self_) { + GST_DEBUG("gst_espeak_start"); GstEspeak *self = GST_ESPEAK(self_); espeak_in(self->speak, self->text); return TRUE; @@ -300,6 +301,7 @@ gst_espeak_start(GstBaseSrc * self_) static gboolean gst_espeak_stop(GstBaseSrc * self_) { + GST_DEBUG("gst_espeak_stop"); GstEspeak *self = GST_ESPEAK(self_); espeak_reset(self->speak); return TRUE; |