Index: remote_speech.cpp
===================================================================
--- remote_speech.cpp	(revision 99)
+++ remote_speech.cpp	(working copy)
@@ -33,6 +33,8 @@
 #include "time.h"
 
 #include "xercesc_utils.hpp"
+#include "xercesc/util/XMLString.hpp"
+#include <xercesc/framework/StdOutFormatTarget.hpp>
 #include "remote_speech.h"
 
 
@@ -72,9 +74,28 @@
 	string encoding= XMLString::transcode(node->getOwnerDocument()->getEncoding()); //XMLStringconverts XML to cString; encoding
 	string version= XMLString::transcode(node->getOwnerDocument()->getVersion ()); //the xml version number
 	string xmlConverted="<?xml version=\"" + version.substr(0,6)+ "\" "; 
-	xmlConverted= xmlConverted+ "encoding=\"" + encoding.substr(0,7) + "\"?>";
-	xml_utils::xmlToString( node, xmlConverted ); //Xml to string recursively searches DOM tree and returns a string of the xml document
+	xmlConverted= xmlConverted+ "encoding=\"" + encoding.substr(0,7) + "\"?>\n";
+
+	DOMNode* newNode = node->cloneNode(true);
+	newNode->getAttributes()->removeNamedItem(L"type");
+	newNode->getAttributes()->removeNamedItem(L"id");
 	
+	xml_utils::xmlToString( newNode , xmlConverted ); //Xml to string recursively searches DOM tree and returns a string of the xml document
+
+	std::size_t pos1 = xmlConverted.find("speech");
+	std::size_t pos2 = 6;
+	xmlConverted.replace(pos1,pos2,"speak version=\"1.0\"\n xmlns=\"http://www.w3.org/2001/10/synthesis\"\n \
+xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n \
+xsi:schemaLocation=\"http://www.w3.org/2001/10/synthesis\n \
+http://www.w3.org/TR/speech-synthesis/synthesis.xsd\" \
+xml:lang=\"en\"");
+
+	//rename node according to ssml DTD <speech> -> <speak>
+	pos1 = xmlConverted.find("</speech>");
+	pos2 = 9;
+	xmlConverted.replace(pos1,pos2,"</speak>");
+
+
 /*	if(xmlConverted=="BADSTRING"){ 
 		printf( "remote_speech::RvoiceXmlCmd ERR: Invalid DOMNode type encountered"); 
 		return(CMD_FAILURE);
@@ -140,8 +161,8 @@
 don't have recipient id, so it is not included.
 The timestamp is 20051121_150427 (that is, YYYYMMDD_HHMMSS ), so we can check old sounds for errors.
 *****************************************/
-	forPlaysound= "dimr/tmpaudio/utt_" +date+ "_"+ time+ "_"+ string(agentName)+"_"+ myStream.str()+".aiff" ; //this is for the unreal playsound command (this is what's sent to unreal through VHMsg)
-	string soundFile= "../../../dimr/tmpaudio/utt_" +date+ "_"+ time+ "_"+ string(agentName)+"_"+ myStream.str()+".aiff"; //gives sound file correct name to Remote speech process (and thus relative to Remote speech process)
+	forPlaysound= "dimr/tmpaudio/utt_" +date+ "_"+ time+ "_"+ string(agentName)+"_"+ myStream.str()+".wav" ; //this is for the unreal playsound command (this is what's sent to unreal through VHMsg)
+	string soundFile= "../../../dimr/tmpaudio/utt_" +date+ "_"+ time+ "_"+ string(agentName)+"_"+ myStream.str()+".wav"; //gives sound file correct name to Remote speech process (and thus relative to Remote speech process)
 	string* soundFilePtr= new string(soundFile);
 	//mcu.character_map.lookup(agentName)->getVoice()-- gets the voice name from the character in meCharacter (it's a string pointer so the * dereferences it)
 	string command= "speak " + string(agentName) +" "+ myStream.str() + " "+ mcuCBHandle::singleton().character_map.lookup(agentName)->get_voice_code()+ " "+ soundFile +" "+ textOfUtt;// text; //concatenates the whole command to be sent to Remote speech process
