I use a free program in Windows called "Levelator" to normalize the audio in WAV files, it doesn't just normalize the whole WAV file - it makes quiet voices louder and loud voices quieter so the output file is all the same volume throughout. If there was any other free tool that did this (and could do it on the command line) I would be using it, but I have never found anything else that does this.
When this Levelator program is run, it opens a GUI. To process a WAV file, you just drag the WAV file over the GUI and it spits out a ".output.wav" version of your original ".wav" file. You can also drag the WAV file over the executable of Levelator (without running Levelator) and get the output file that way.
What you cannot do is use it on the command line, in any way!
Nothing I have tried will work in a batch file, for example this:
start /wait Levelator.exe myaudio.wav
Or with quotes:
start /wait Levelator.exe "myaudio.wav"
Results in the error: "Can't open the source file: myaudio.wav"
Also, running this brings up nothing:
Levelator.exe /?
That just causes the same error: "Can't open the source file: /?"
I got thinking about this and wondered, if you can drag the WAV file over the executable, why can't that be handled in a batch file? If the first command above doesn't work, why not? Why are you forced to either drag the WAV file over the GUI or drag the WAV over the executable?
It's odd that the program can't open a WAV file by specifying the file name after Levelator.exe in a batch file. It seems impossible to do it.
It's frustrating because I always have to manually drag WAV files over the GUI, but with a batch file (and creating a variable for the name of any WAV) it would be miles easier.
Since this can't work in a batch file, how can I mimic dragging and dropping on the command line? This is the only way to do it. I would usually use AutoIt2 for this sort of thing but the position of the WAV file in a folder can't be guessed at, so it can't be done that way either, AutoIt2 just isn't that advanced and needs window coordinates to drag something somewhere.
I know it's a tall order, that's why I ask it here :p
EDIT: The suggestion by user14122392 led to making it work :)
I put the following in a batch file next to Levelator.exe and the WAV file, hopefully it's made universal so no editing is needed, it can just run if a WAV file is put there...
For %%a IN ("*.wav") DO Set "WAVFILE=%%~na"
start /wait levelator.exe "%~dp0\%WAVFILE%.wav"
This allows for a WAV file with any filename (not sure about file names with a "!" character, I know Levelator doesn't like them) and by using "%~dp0" it is enough to fool it into working.
"C:\Folder\Levelator.exe" "C:\Folder\myaudio.wav"
When you drag, Windows uses full paths so BOTH files are exactly specified. The program file for starting a program, then the program knows exactly where to look for the source file.
Also start
is for starting programs in unusual ways. Type start /?
for help on using start
and starting programs normally.
The !
is not a special character in CMD unless you turn a special mode on. It is never a special character in MS-Dos so you need to tell CMD to treat it as one. See setlocal /?
, set /?
, and cmd /?
.