I have a program written in C # and values ​​calculated by praat (phonetics software). I already have a praat script working with praatcon.exe that prints the results to the Windows console (cmd.exe). Can I use this result in my C # application? How?
Or is there a better way to get results, for example. with the sendocket command? How to use this?
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 option with praatcon.exe. See explanation here .
source share