I'm calling qaac.exe
(AAC encoder) from Process.Start()
. The qaac.exe
program outputs to the same line while it is encoding. I'm not sure what the technical term for it is, but it causes the program to not exit even though it is done processing the file. Here is my code:
string output = null;
var proc = new Process();
proc.StartInfo.FileName = "qaac.exe";
proc.StartInfo.Arguments = "-v256 -q2 file.wav";
proc.StartInfo.WorkingDirectory = @"C:\";
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
output = proc.StandardOutput.ReadToEnd();
output += "\r\n";
output += proc.StandardError.ReadToEnd();
proc.WaitForExit();
If I pass in the -s
argument (suppress console messages) to the qaac.exe
app in the code above it works fine. So my question is how do I grab the output from an external program that writes to the same line in the console window?