Subject:PreRender + SaveAs
Posted by: korigan
Date:10/20/2005 3:19:49 AM
Hello, When I try to SaveAs a file with my following MP3 parameters my app crashes, but curiously it works fine when using the following lines for WAV. Do you have any idea ? ISfRenderer rend = appSF.FindRenderer("MP3 Audio .mp3)",".mp3"); ISfGenericPreset preset = rend.GetTemplate("Default Template"); //ISfRenderer rend = appSF.FindRenderer("Microsoft(Wave)","WAV"); //ISfGenericPreset preset = rend.GetTemplate("Default Template"); // Transformation du fichier appSF.OpenFile(file,false,false); ISfDataWnd wnd = appSF.ActiveWindow; if (wnd != null) { ISfFileHost FileMusic = wnd.File; FileMusic.SaveAs("c:\toto.mp3",rend.Guid, preset, RenderOptions.OverwriteExisting); } |
Subject:RE: PreRender + SaveAs
Reply by: jetdv
Date:10/20/2005 6:35:16 AM
What if you change this line: ISfRenderer rend = appSF.FindRenderer("MP3 Audio .mp3)",".mp3"); To this: ISfRenderer rend = appSF.FindRenderer("MP3 Audio","MP3"); Message last edited on10/20/2005 6:35:46 AM byjetdv. |
Subject:RE: PreRender + SaveAs
Reply by: korigan
Date:10/20/2005 7:16:36 AM
Thank you for your reply, I've tried your line but it doesn't work better. In fact I've tried with the batch script too but it can't convert my file either. (An error message is displayed) |
Subject:RE: PreRender + SaveAs
Reply by: jetdv
Date:10/20/2005 8:01:09 AM
Here's how I did it in my BatchConvert script //Set the new file name newFile = bcDestBox.Text + newFile + rend.Extension; //Get the selected preset from the dropdown box ISfRenderer rend = (ISfRenderer)forge.Renderers[cmbFormat.SelectedIndex]; //Use the "default" preset preset = rend.GetTemplate(0); //Set the render options RenderOptions opt = new RenderOptions(); opt = RenderOptions.OverwriteExisting; //Save to the new file type forgefile.RenderAs(newFile, rend.Guid, preset, new SfAudioSelection(0,-1), opt); I tried "SaveAs" but it didn't seem to work as well as "RenderAs" for this purpose at the time. You can also try my Batch Convert script Message last edited on10/20/2005 8:04:19 AM byjetdv. |
Subject:RE: PreRender + SaveAs
Reply by: ForumAdmin
Date:10/20/2005 1:08:52 PM
Make sure you've registered the mp3 plug-in (by saving one from within Sound Forge). J. |
Subject:RE: PreRender + SaveAs
Reply by: korigan
Date:10/21/2005 2:21:07 AM
Thank you for your answers. I tried the jetdv's batchconverter and I still have the same error. Could you just explain to me how to register a mp3 plug-in in Sound Forge. (and where I can find this plug-in). What I have to say also, is that everything works perfectly well when I do it manually. |
Subject:RE: PreRender + SaveAs
Reply by: jetdv
Date:10/21/2005 6:37:12 AM
WHAT is the error message? |
Subject:RE: PreRender + SaveAs
Reply by: korigan
Date:10/21/2005 10:17:13 AM
Here it is, I'm not sure this can be helpful, if you need something else, just let me know. ************** Texte de l'exception ************** System.Runtime.InteropServices.COMException (0x8004E086): Exception de HRESULT : 0x8004E086. at SoundForge.ISfFileHost.RenderAs(String strFilename, String strFormatNameorGUID, Object vTemplateNameOrData, SfAudioSelection asel, RenderOptions opt) at BatchConvert.BatchConvertForm.btnConvert_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) |
Subject:RE: PreRender + SaveAs
Reply by: jetdv
Date:10/21/2005 11:02:53 AM
I got the same error but I know that MP3 is NOT registered on the machine I tested on. (i.e. click on "Custom" and it now tells me I have 19 more uses). |
Subject:RE: PreRender + SaveAs
Reply by: _TJ
Date:10/21/2005 9:58:55 PM
If you have not registered the MP3 plugin, then you can encode up to 20 times manually before it refuses. Until you register, you cannot batch encode or script encode at all. To Register, Choose Save As from the File menu. Set the Save as type to MP3 Audio Choose the Custom... button next to the Template There should be a Register button on the dialog that pops up, there should also be an indication of how many of the 20 encodes you have used up. tj |
Subject:RE: PreRender + SaveAs
Reply by: jetdv
Date:10/22/2005 5:55:41 AM
Just tested on another computer on which the MP3 encoder IS registered and the process worked fine. |