Subject:Batch cvtr 5.0b or sforge 8.0b batch help?
Posted by: jaydeeee
Date:12/8/2005 12:01:58 PM
Can you help please? I have the batch converter 5.0b and sforge 8.0b, I'm looking for help in setting up a batch process to setup audio previews... - take a bunch of .wavs and auto cut them to 13sec max length - add a 1 sec fade out at the end of each file (from sec 12 to 13 essentially) I have been using sf batch covnerter 5.0b for years and am very new to forge's 8.0b batch converting. Can anybody help with specific "how to" info to accomplish this? Uggh, I'm new to forge 8.0b's batch scripting, does one have to use scripting to accomplish this?...or will the old sf batch cvtr 5.0b work for all this? Can you give an example script for 8.0b? thanks so much thanks |
Subject:RE: Batch cvtr 5.0b or sforge 8.0b batch help
Reply by: _TJ
Date:12/13/2005 11:52:48 PM
The script CropAndFade.cs does most of what you want on a single file. here's a modified version that also operates on a the currently open file. using System; using System.IO; using System.Windows.Forms; using SoundForge; //crop the current file to 13 sec, then fade out the last 1 sec public class EntryPoint { public void Begin(IScriptableApp app) { ISfFileHost file = app.CurrentFile; if (null == file) return; // wrap up the crop & fade in a single undo bool fCancel = false; int idUndo = file.BeginUndo("Crop to 13 sec and Fade Out"); // crop the file to 13 sec file.CropAudio(0, file.SecondsToPosition(13.0)); // fade out the last 1.0 seconds Int64 ccFade = file.SecondsToPosition(1.0); file.DoEffect("Graphic Fade", "-6 dB exponential fade out", new SfAudioSelection(file.Length - ccFade, ccFade), EffectOptions.EffectOnly); SfStatus result = file.WaitForDoneOrCancel(); if (result != SfStatus.Success) fCancel = true; file.EndUndo(idUndo, fCancel); DPF("Done - {0}", fCancel ? "failed and rewound changes" : "success"); } public void FromSoundForge(IScriptableApp app) { ForgeApp = app; //execution begins here app.SetStatusText(String.Format("Script '{0}' is running.", Script.Name)); Begin(app); app.SetStatusText(String.Format("Script '{0}' is done.", Script.Name)); } public static IScriptableApp ForgeApp = null; public static void DPF(string sz) { ForgeApp.OutputText(sz); } public static void DPF(string fmt, object o) { ForgeApp.OutputText(String.Format(fmt,o)); } public static void DPF(string fmt, object o, object o2) { ForgeApp.OutputText(String.Format(fmt,o,o2)); } public static void DPF(string fmt, object o, object o2, object o3) { ForgeApp.OutputText(String.Format(fmt,o,o2,o3)); } } //EntryPoint Message last edited on12/13/2005 11:54:08 PM by_TJ. |