HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: nintendoeats on 2018-05-14 14:55:02

Title: Software To Batch Trim The End Of WAVs
Post by: nintendoeats on 2018-05-14 14:55:02
I'm working on a project using MIDI from a video game which comes in short (5 - 10 second mostly) segments of four bars each. The best software I have found for exporting these to WAV is Foobar's Foo_MIDI plugin. The only issue I have is that it automatically applies a loop and fade out when exporting using BASSMIDI, and I cannot make that extra bit shorter than 10ms. The effect this has on transitions is subtle and most users probably won't notice, but if I'm going to spend dozens of hours listening to these tracks I really need to get rid of that fade for my own sanity.

All I need to do is trim 10ms off the end off every file. The problem is that I have exported nearly 20 different versions of each section using different soundbanks and now have over 4000 files to work with. I've tried a bunch of different software and nothing free is doing quite what I need. I am actually at a point where I would consider buying something (but am not in a position to make major purchases at the moment, moving across the province in a month).

Does anybody know of something that does what I need?

Thanks!

(P.S. bonus points if it can maintain an existing file structure during the process)
Title: Re: Software To Batch Trim The End Of WAVs
Post by: Wombat on 2018-05-14 17:06:19
I once used SoX to batch trim a defined number of samples from the end with the example .cmd file SoX provides.
There may be even more options like the value used in ms but i didn't check this.
This code is for 1000 samples.
Code: [Select]
rem Example of how to do batch processing with SoX on MS-Windows.
rem
rem Place this file in the same folder as sox.exe (& rename it as appropriate).
rem You can then drag and drop a selection of files onto the batch file (or
rem onto a `short-cut' to it).
rem
rem In this example, the converted files end up in a folder called `converted',
rem but this, of course, can be changed, as can the parameters to the sox
rem command.

cd %~dp0
mkdir converted
FOR %%A IN (%*) DO sox %%A "converted/%%~nxA" trim 0s -1000s
pause
Title: Re: Software To Batch Trim The End Of WAVs
Post by: nintendoeats on 2018-05-14 17:16:11
Great thanks, I'll give that a go!
Title: Re: Software To Batch Trim The End Of WAVs
Post by: nintendoeats on 2018-05-14 21:14:41
After much arguing with my old nemesis "the batch file" I have managed to have Sox create a copy of my entire folder structure with just the required trim. I think that perhaps I should learn how to use Sox more thoroughly, I have a feeling I'm going to be needing it again.