private void ProcessRequest(HttpListenerContext context) { var req = context.Request; var reqBody = new StreamReader(req.InputStream, Encoding.Default).ReadToEnd(); var wav = Automator.TextToSpeech(reqBody); context.Response.StatusCode = 200; context.Response.OutputStream.Write(wav, 0, wav.Length); context.Response.Close(); }
private void OnExecute(CommandLineApplication app) { var outputFileName = Path.GetTempFileName(); var psi = new ProcessStartInfo { FileName = ExecutableFileName, UseShellExecute = false }; SetupProfiler(psi.EnvironmentVariables, PROFILER_UUID, ProfileDllFileName, outputFileName); using (var process = new System.Diagnostics.Process()) { process.StartInfo = psi; process.Start(); var automator = new Automator(process, outputFileName); var server = new HttpServer(automator); server.Start(); process.WaitForExit(); } }
public HttpServer(Automator automator) { Automator = automator; }