if (mapper_osso_init()!=0)
return 1;
set_var_defaults();
-#if defined (WITH_GST) && defined (WITH_ESPEAK)
+#if defined (WITH_GST)
gst_init(&argc, &argv);
-speak_init(120,50);
#endif
gtk_init(&argc, &argv);
gconf_init(argc, argv, NULL);
mapper_init(argc, argv);
if (mapper_osso_cb_init()!=0)
return 1;
+#if defined (WITH_GST) && defined (WITH_ESPEAK)
+speak_init("en",_voice_speed,_voice_pitch);
+#endif
gtk_main();
mapper_destroy();
#if defined (WITH_GST) && defined (WITH_ESPEAK)
GstElement *src;
GstElement *queue;
GstElement *caps;
- GstElement *conv;
GstElement *sink;
gboolean done;
gshort *buffer;
"channels", G_TYPE_INT, 1,
NULL);
-ge.conv=gst_element_factory_make("audioconverter", "converter");
ge.queue=gst_element_factory_make("queue", "queue");
ge.sink=gst_element_factory_make(AUDIO_SINK, "sink");
+g_assert(ge.pipeline);
+g_assert(ge.src);
+g_assert(ge.caps);
+g_assert(ge.srccaps);
+g_assert(ge.queue);
+g_assert(ge.sink);
+
g_object_set(ge.caps, "caps", ge.srccaps, NULL);
gst_bin_add_many (GST_BIN(ge.pipeline), ge.src, ge.queue, ge.sink, NULL);
static void
espeak_buffer_free(void *p)
{
-g_print("Buffer free\n");
g_free(p);
}
data=g_memdup(wav, numsamples);
buf=gst_app_buffer_new (data, numsamples, espeak_buffer_free, data);
gst_buffer_set_caps(buf, ge.srccaps);
- gst_app_src_push_buffer (GST_APP_SRC (ge.src), buf);
+ gst_app_src_push_buffer(GST_APP_SRC (ge.src), buf);
}
return 0;
}
gboolean
-speak_init(guint speed, guint pitch)
+speak_init(gchar voice, guint speed, guint pitch)
{
erate=espeak_Initialize(AUDIO_OUTPUT_RETRIEVAL, 100, NULL, 0);
if (erate==-1)
return FALSE;
espeak_SetSynthCallback(espeak_cb);
-espeak_SetVoiceByName("en");
+espeak_SetVoiceByName(voice);
espeak_SetParameter(espeakRATE, speed,0);
espeak_SetParameter(espeakPITCH, pitch,0);
espeak_SetParameter(espeakVOLUME, 100,0);
#else
-gboolean speak_init(guint speed, guint pitch) {return TRUE;}
+gboolean speak_init(gchar voice, guint speed, guint pitch) {return TRUE;}
void speak_deinit(void) {}
gboolean speak_stop(void) {return TRUE;}
gboolean speak_speaking(void) {return FALSE;}