I have a program written in C# and values calculated by praat (phonetics software). I already have a praat script running with praatcon.exe which prints the results on a Windows console (cmd.exe). Can I use this result in my C# application? How?
Or is there a better way to get the results, e.g. with the command "sendsocket"? How to use this one?
Edit: It works great with this code:
ProcessStartInfo si = new ProcessStartInfo();
si.FileName = "praatcon.exe"; //name of the handle program from sysinternals
//assumes that it is in the exe directory or in your path
//environment variable
//the following three lines are required to be able to read the output (StandardOutput)
//and hide the exe window.
si.RedirectStandardOutput = true;
si.WindowStyle = ProcessWindowStyle.Hidden;
si.UseShellExecute = false;
si.Arguments = "-a example.praat filename.wav"; //you can specify whatever parameters praatcon.exe needs here; -a is mandatory!
//these 4 lines create a process object, start it, then read the output to
//a new string variable "s"
Process p = new Process();
p.StartInfo = si;
p.Start();
string s = p.StandardOutput.ReadToEnd();
It is VERY important to use the "-a" parameter with praatcon.exe. See explanation here.