Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted
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.
Nothing is as illusive as 'the last bug'.
Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...