Getting values ​​from praat using a C # program

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 .

+4
source share
2 answers

Here's how to capture the console output of another exe.

This is all in the System.Diagnostics namespace.

 ProcessStartInfo si = new ProcessStartInfo(); si.FileName = "praat.exe"; //name of the program //assumes that its 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 = "InputArgsHere"; //You can specify whatever parameters praat.exe needs here //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(); 
+5
source

I think that in order to receive the required data there should be a service that connects you with the recommendation.

0
source

All Articles