// Copyright 2012 Nexiwave Canada. All rights reserved. // Nexiwave Canada PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; namespace ConsoleApplication1 { class MyWebClient : WebClient { protected override WebRequest GetWebRequest(Uri uri) { WebRequest w = base.GetWebRequest(uri); w.Timeout = 30 * 60 * 1000; return w; } } class Program { static void Main(string[] args) { // change these: String user = args[0]; String passwd = args[1]; String wavFile = args[2]; // send: String url = "https://api.nexiwave.com/SpeechIndexing/file/storage/" + user + "/recording/?authData.passwd=" + passwd + "&response=application/raw-transcript&targetDecodingConfigName=voicemail&auto-redirect=true"; // Comment this out to receive transcript in plain text (for SMS, for example) url = url + "&transcriptFormat=html"; using (MyWebClient wc = new MyWebClient()) { byte[] myByteArray = wc.UploadFile(url, wavFile); System.Text.Encoding enc = System.Text.Encoding.ASCII; string resp = enc.GetString(myByteArray); // perform magic with the transcript here: Console.Write(resp); } } } }