Community Forums Archive

Go Back

Subject:Question regarding RunBatchJob.cs & file extension
Posted by: atc_listener
Date:6/29/2016 2:05:03 PM

Hi - hoping someone is still browsing this forum who may be able to provide some help!

I've scripted a C# app to handle file processing and to batch process a large number of files via multiple batch jobs. The meat of the app runs from a (slightly) modified RunBatchJob.cs, the sample of which came from the SDK.

The process works as follows:

1. Execute Sound Forge and immediately run RunBatchJob.cs

2. I've provided RunBatchJob.cs the .bj file and location of my audio files via script arguments. A FileRegionCollection is made of my audio files

3. Process files via creating a new Engine and executing engine.Run(bj, FileRegionCollection)

---

All of this runs great - except instead of overwriting my existing files (.wav's), Sound Forge creates brand new .aa3 files. These are completely useless to me unfortunately...

I can't find the run function in BatchEngine.cs (thinking maybe I could hard-code it to only serve .wav files). Also when I run the batch converter via UI and manually feed it each .bj file, it correctly spits out overwritten .wav files and generates .sfk files.

Any suggestions on how to get .wav files from the script rather than .aa3??

Thanks!!

Subject:RE: Question regarding RunBatchJob.cs & file extension
Reply by: roblesinge
Date:7/1/2016 9:19:45 AM

Without seeing your code, I can only make a guess, but did you set up the batch jobs to output .wav files. That would be the first thing to try. I've never personally scripted the actual running of the batch processing. I usually just apply the effects via scripting.

-Rob.

Subject:RE: Question regarding RunBatchJob.cs & file extension
Reply by: atc_listener
Date:7/6/2016 9:32:24 PM

Thanks for the follow up Rob! The .bj XML (as far as I can tell) is instructing the converter to save Same As Source - which... the source is a wav file... but I'm still getting AA3's. Below is the XML from one of the presets I'm using (hopefully formatted correctly).

----------

<?xml version="1.0"?>
<BatchJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ProcessList>
<Preset>
<OwnerNameText>Sony Time Stretch</OwnerNameText>
<PresetName>Time expand 120 % of original</PresetName>
<PresetData>NAAAAKS09V+PhdARrrwAoMkFORIAAAAAAHDHQAAAAADgLgAAAAAAAPgvREEAAAAAAAAAAA==</PresetData>
<PresetOwner>b97c0f22-196d-11d1-b99b-00a0c9053912</PresetOwner>
<OutPreserveSubfolders>false</OutPreserveSubfolders>
</Preset>
</ProcessList>
<RenderList>
<Preset>
<OwnerNameText>Same as source</OwnerNameText>
<PresetName>Same as source</PresetName>
<PresetData>6AIAAAAABQIAAAAAAAAAAAAAAAAAAAAAJvKon+YEokmJTDd5BCOGPbV/VLVtz5A+koifDozhYGHIAAAAAQAAAAAAAAAAAAAAIAAAABEAAABErAAAAgAEAAAAAAAAAAAAAAAAABCxAgAAAAAAAAAAAAAAAAAAAAAAAQAAADwAAIAAAAAAAAAAAAQABAAAAPBCIAAAAAAAAABErAAAAgAEAAAAAAAIAAAAdAIQAMBdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAIAAAACLKAABAAAAAAAAAAAAAAAAAAAAAADuAgAAAgAARKwAABAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFMAYQBtAGUAIABhAHMAIABzAG8AdQByAGMAZQAAAE4AbwByAG0AYQBsACAAcgBlAGMAbwByAGQAaQBuAGcAIABxAHUAYQBsAGkAdAB5AAAAeQAAAA==</PresetData>
<PresetOwner>9fa8f226-04e6-49a2-894c-37790423863d</PresetOwner>
<OutFolder>Same as source</OutFolder>
<OutPreserveSubfolders>false</OutPreserveSubfolders>
<OutFileAppend>Same as source</OutFileAppend>
</Preset>
</RenderList>
<MetadataSet />
</BatchJob>

----------

Thanks for any more help!

Subject:RE: Question regarding RunBatchJob.cs & file extension
Reply by: atc_listener
Date:7/6/2016 9:35:20 PM

And if you do have any further suggestion re: scripting the processing of files - feel free to pass it on.

I've pursued the batch converter/batch job route as this was a previously established process (not scripted however). I'm routinely processing 10k+ files at one time this way - but if there's a better suggestion I'd happily do my best to learn :)

Subject:RE: Question regarding RunBatchJob.cs & file extension
Reply by: roblesinge
Date:7/7/2016 7:52:54 AM

So, the XML nodes that mention Same as Source are actually output directory and the output file name. If you open the Batch Job in Sound Forge and change the save type to an actual wav format, that should result in the necessary change to the XML that you're looking for.

If you're ever interested in scripting this, take a look at some of my previous posts. I've done a lot of the main things you'll be looking to do like looping over files, opening files, applying effects and then saving the files out to new files.

But, if what you're doing works, go for it.

Rob.

Subject:RE: Question regarding RunBatchJob.cs & file extension
Reply by: atc_listener
Date:7/13/2016 3:45:17 PM

You're brilliant Rob - this worked perfectly! Thanks so much!!!

Go Back