[Freeswitch-svn] [commit] r5890 - freeswitch/trunk/src/mod/asr_tts/mod_openmrcp

Freeswitch SVN anthm at freeswitch.org
Tue Oct 16 11:25:38 EDT 2007


Author: anthm
Date: Tue Oct 16 11:25:38 2007
New Revision: 5890

Modified:
   freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c

Log:
fix xml to work with v1/voxeo

Modified: freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c	Tue Oct 16 11:25:38 2007
@@ -527,16 +527,33 @@
 	mrcp_message_t *mrcp_message;
 
 	char *text2speak;
-	const char xml_head[] = 
+	const char v2_xml_head[] = 
 		"<?xml version=\"1.0\"?>\r\n"
 		"<speak>\r\n"
 		"<paragraph>\r\n"
 		"    <sentence>";
 
-	const char xml_tail[] = "</sentence>\r\n"
+	const char v2_xml_tail[] = "</sentence>\r\n"
 		"</paragraph>\r\n"
 		"</speak>\r\n";
 
+    const char v1_xml_head[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+        "<speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\">\n";
+
+
+    const char v1_xml_tail[] = "\n</speak>\n";
+
+	const char *xml_head, *xml_tail;
+
+	if (tts_session->profile->mrcp_options->proto_version == 1) {
+		xml_head = v1_xml_head;
+		xml_tail = v1_xml_tail;
+	} else {
+		xml_head = v2_xml_head;
+		xml_tail = v2_xml_tail;
+	}
+
+
 	size_t len = sizeof(xml_head) + sizeof(text) + sizeof(xml_tail);
 	text2speak = (char *) switch_core_alloc(tts_session->pool, len);
 	strcat(text2speak, xml_head);



More information about the Freeswitch-svn mailing list