gardet Posted September 8, 2009 Posted September 8, 2009 I have this application where i drop a audiofile in a textbox and it then uses besweet to encode the file. It almost works great, besweet does it work, but looks like the application doesn´t recognize it has ended. I use the follow code (that i found at microsofts homepage): ProcessStartInfo pInfo = new ProcessStartInfo(); pInfo.FileName = this.besweet; pInfo.Arguments = "-core( -input \""+this.audiofile+"\" -output \""+this.finalaudio+ "\" -logfilea \""+this.logfile+"\" ) -azid( -c normal -L -3db ) -ota( -hybridgain ) -lame( -p --alt-preset "+this.bitrate+" )"; Process p = Process.Start(pInfo); p.WaitForInputIdle(); p.WaitForExit(); MessageBox.Show("Code continuing..."); The messagebox never popup, i have looked in the task manager and besweet does terminate but the application dont see it. Solution/Reason for that? Quote
Administrators PlausiblyDamp Posted September 8, 2009 Administrators Posted September 8, 2009 What happens if you remove the line p.WaitForInputIdle() and try again? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Wile Posted September 9, 2009 Posted September 9, 2009 Did you set the EnableRaisingEvents property on the process to true? As far as I know, your application wont get the information that the process has stopped without it. Quote Nothing is as illusive as 'the last bug'.
gardet Posted September 10, 2009 Author Posted September 10, 2009 What happens if you remove the line p.WaitForInputIdle() and try again? strange, it works when i remove that line, thank you so much, guess it dosnt idle before the process ends, or something, problem solved at least, thanks again Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.