Log in

View Full Version : Create a GUI for a batch file in Delphi


doctorjellybean
28th May 2008, 20:07
If this is the wrong place, please accept my apologies.

I found a batch file which contains code to normalize AC3 files. This is the code in the batch file:

for %%a in ("*.ac3") do @echo SetMemoryMax(768) >"%%~na.avs"
for %%a in ("*.ac3") do @echo LoadPlugin("bassAudio.dll") >>"%%~na.avs"
for %%a in ("*.ac3") do @echo LoadPlugin("AudioLimiter.dll") >>"%%~na.avs"
for %%a in ("*.ac3") do @echo BassAudioSource("%%a").normalize(0.98) >>"%%~na.avs"
for %%a in ("*.avs") do wavi "%%a" - | aften.exe -v 0 -b 384 -readtoeof 1 - "Normalized-%%~na_Music.ac3"

When the batch file is executed, an avs file is created:

SetMemoryMax(768)
LoadPlugin("bassAudio.dll")
LoadPlugin("AudioLimiter.dll")
BassAudioSource("5000 Volts - Dr Kiss Kiss.ac3").normalize(0.98)

Now I guess I can create a procedure in Delphi to process the first 3 lines. What I would like to know is what happens in the last line of the batch file. There are 2 applications in the same folder as the batch file; wavi and aften and they are obviously used in the last line. Perhaps someone could explain to me what happens there, so I could create something similar in Delphi.

Thanks in advance.

J_Darnley
28th May 2008, 21:27
wavi opens the script and passes audio data to aften. Are you not familiar with a pipe?

doctorjellybean
28th May 2008, 21:33
wavi opens the script and passes audio data to aften. Are you not familiar with a pipe?
Thanks.

I have a vague idea, as I have not done that for ages. I found the official aften webpage which explains all the switches.

We all had to start somewhere.