Post Process aepp XML script

So today I decided to look at Post Process XML scripts.
On Windows they are located in the folder:

c:\ProgramData\Steinberg\Audio Export Post Process Scripts\

I took an existing aepp script and modified it to make a mp3 copy of an exported Wav file:

<?xml version="1.0" encoding="UTF-8"?> Make a mp3 copy using Lame lame.png Lame 3.99.5 C:\Lame\lame.exe "$PATH" false false

I made an icon for it, the lame.png 32x21 pixels (the others where 32x32 pixels that I assume is the max)
The rest should be fairly self explanatory.

My problem that I have not been able to figure out is to parse settings along to Lame.
Right now it renders the wav and Lame encodes a mp3 copy to the same folder as the file destination chosen in the Export path setting, and that is fine.
But it always uses the Lame default setting, 128kbps.
I want to put a " -b 320 " setting in there. something like “Lame.exe -b 320 audio.wav” where it now does a “Lame.exe audio.wav”

Anyone familiar with XML, that could give me a hint ?

How it looks like.

Hi peakae,

I don’t know anything about this but you could try putting your parameter into the argument variable after the $path.

Thanks will have a look, that hadn’t crossed my mind. :slight_smile:

The suspense is killing me; did this work? :slight_smile:

OK, you’ve got me curious now …

I can’t find any documentation on these .aepp scripts so I’ve done some experimenting on Windows, so I lazily copied ExplorerFolder.png and called it CommandLine.png, then created a new file called CommandLine.aepp with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<AudioExportPostProcess>
   <Description>Open a command line</Description>
   <Icon>CommandLine.png</Icon>
   <Executable>
      <Path>C:\Windows\system32\cmd.exe</Path>
      <Argument>/k echo $PATH</Argument>
   </Executable>
   <RunOnce>false</RunOnce>
   <WaitDone>false</WaitDone>
</AudioExportPostProcess>

The idea is to open a command line (the /k parameter keeps it open) and print out whatever is contained in the $PATH variable. The result is that a single line is printed which is the fully-qualified rendered filename, so including the drive, path and extension, but annoyingly with a trailing quote. So the logic for constructing the string which is passed to the OS for execution appears to be:

+ + + +

or in other words, something like:
“C:\Windows\system32\cmd.exe /k echo C:\Projects\MyStuff\Test\test-audio.wav”

In this case the Argument element is exactly this string:
/k echo C:\Projects\MyStuff\Test\test-audio.wav"

Following on from that, the OP should be able to achieve what is required by using the following:
-b 320 $PATH
… or pretty much what RichardTownsend said, except that the parameter needs to come before the $PATH.

I’d also be pretty sure that the following would work:

<?xml version="1.0" encoding="UTF-8"?>
<AudioExportPostProcess>
	<Description>
		<us>Make a mp3 copy using Lame</us>
	</Description>
	<Icon>lame.png</Icon>
	<Executable>
		<Name>Lame</Name>
		<Version>3.99.5</Version>
		<Path>C:\Lame\lame.exe -b 320</Path>
		<Argument>"$PATH"</Argument>
	</Executable>
	<RunOnce>false</RunOnce>
	<WaitDone>false</WaitDone>
</AudioExportPostProcess>

(the parameter is in the executable’s Path element)

[EDIT:] I’ve attached the files for further experimentation (even including a “proper” command line icon!)
CommandLine_Post_Process_Script.zip (1.17 KB)

1 Like

Thanks will have a look, I have been slammed at work and have only had time to install some monitoring tools to determine what arguments actually gets passed. You idea using cmd is a much better approach, that gives me something to work with.
Thank you so much.

Ok finally got it working.
I had to do a little workaround on that one.
Your suggestion using :
C:\Lame\lame.exe -b 320
Did not work, Cubase refuse to display the aepp in the pulldown menu.
I spend a few hours trying all combination of quotes in front, in the middle, after. The command box would open for a millisecond and the nothing :slight_smile:
The solution was pretty simple, run Lame from a .cmd file.

I made a lamebat.cmd file that has the following inside it:

C:\Lame\Lame.exe -b 320 %1

I then changed the aepp xml :

<?xml version="1.0" encoding="UTF-8"?>
<AudioExportPostProcess>
<Description>
<us>Make a mp3 copy using Lame</us>
</Description>
<Icon>lame.png</Icon>
<Executable>
<Name>Lame</Name>
<Version>3.99.5</Version>
<Path>C:\Lame\lamebat.cmd</Path>
<Argument>"$PATH"</Argument>
</Executable>
<RunOnce>false</RunOnce>
<WaitDone>false</WaitDone>
</AudioExportPostProcess>

This now actually has potential, the batch file “lamebat.cmd” can easily be expanded on to do encoding in other formats or sample rate conversion.
So export one time and get 96k, 48k, 44.1k wavs, mp3, mp4, flac and what not in one swoop. (after figuring out how not to overwrite same format files)
The same must be possible on Mac, I am not familiar with the command line interface it uses, so no idea how to do it on a Mac.

Going to clean it up a little and post a new thread, add links to Lame, and ZIP aepp and the cmd files.
Thanks for your input, helped a lot.

1 Like

Excellent! Well done! :smiley: