Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-04-29 19:19:37 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-04-29 19:25:01 (GMT)
commitb2eae83754a750c6ac4964322ba6ff9e172c4d99 (patch)
tree1e0c6576d8d433feca29b470e1a1019da4744544
parent51ad08e7323b78c2a0a0ba12351c595929b57939 (diff)
Support utf-8 source strings #816
-rw-r--r--src/espeak.c20
-rw-r--r--src/gstespeak.c2
2 files changed, 16 insertions, 6 deletions
diff --git a/src/espeak.c b/src/espeak.c
index b119e7d..b44bafa 100644
--- a/src/espeak.c
+++ b/src/espeak.c
@@ -346,8 +346,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;
}
@@ -381,8 +382,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)
@@ -524,8 +527,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 };
@@ -614,6 +619,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;