return 0;
}
+void
+speak_set_parameters(guint speed, guint pitch)
+{
+espeak_SetParameter(espeakRATE, speed, 0);
+espeak_SetParameter(espeakPITCH, pitch, 0);
+}
+
gboolean
speak_init(gchar *voice, guint speed, guint pitch)
{
espeak_SetSynthCallback(espeak_cb);
espeak_SetVoiceByName(voice);
-espeak_SetParameter(espeakRATE, speed, 0);
-espeak_SetParameter(espeakPITCH, pitch, 0);
+speak_set_parameters(speed, pitch);
espeak_SetParameter(espeakVOLUME, 100, 0);
if (speak_create_pipeline()==FALSE)
return FALSE;
-bus=gst_pipeline_get_bus (GST_PIPELINE (ge.pipeline));
+bus=gst_pipeline_get_bus(GST_PIPELINE (ge.pipeline));
g_assert(bus);
-gst_bus_add_watch (bus, bus_call, NULL);
+gst_bus_add_watch(bus, bus_call, NULL);
return TRUE;
}
void
speak_deinit(void)
{
-gst_element_set_state (ge.pipeline, GST_STATE_NULL);
-gst_object_unref (ge.pipeline);
+gst_element_set_state(ge.pipeline, GST_STATE_NULL);
+gst_object_unref(ge.pipeline);
ge.pipeline=NULL;
speaking=FALSE;
+espeak_Terminate();
}
gboolean
void speak_deinit(void) {}
gboolean speak_stop(void) {return TRUE;}
gboolean speak_speaking(void) {return FALSE;}
+void speak_set_parameters(guint speed, guint pitch) {}
gboolean
speak_text(gchar *text)