string url = "http://localhost/MyService/Help.asmx?op=DoHelp"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); //HttpRequest req = HttpContext.Current.Request; req.Headers.Add("Id", "354535018567138"); req.Headers.Add("format", "1"); req.Headers.Add("Name", "0"); req.ContentType = "audio/x-speex;rate=16000"; req.Method = "POST"; byte[] audioData = null; string path = Server.MapPath("."); path += "\\AudioFile\\audio_16k16bit.spx"; //string xx = Nuance.DoVoiceRecognition(); audioData = File.ReadAllBytes(path); Stream datastream = req.GetRequestStream(); datastream.Write(audioData, 0, audioData.Length); datastream.Close(); WebResponse res = req.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream()); string outputResult = sr.ReadToEnd();
[System.Web.Script.Services.ScriptService]
<br /> [System.Web.Script.Services.ScriptService]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)