Help - Search - Members - Calendar
Full Version: Question: Lame Batch decoding
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
PhilG
Hi,
I try to build an installer(NSIS) for a game mod which should decode the soundfiles from MP3 to wav during installation.
I integrated Lame into the installer and the problem is to define the right batch command.
There are 855 mp3 files in 3 folders and 2 subfolders and should be unpacked and decoded with the same structure.
I tried to decode the files with lame -S --decode "folder/*.mp3", but this gives me *.mp3.wav files as result.
I donīt want to write 855 times (lame -S --decode "folder/1.mp3" "folder/1.wav"), so is there another way to do it and is there a command switch to delete the mp3 afterwards?

Thx

PhilG
PhilG
Problem solved.
Lame isnīt capable of decoding complete directories and a batch makes no sense, because of the chooasble target directory during installation.
I had to write 855 times (lame -S --decode "folder/1.mp3" "folder/1.wav") etc.
But I had the idea to let this work do by a macro I recorded for the first line.
Daijoubu
wth are you trying to do? Rip a game? I smell gamez... shifty.gif
evereux
for %a in (*.mp3) do lame --decode "%a"

from within a bat file you need todo %% not just %
kwanbis
QUOTE(PhilG @ Oct 1 2004, 05:28 AM)
I try to build an installer(NSIS) for a game mod which should decode the soundfiles from MP3 to wav during installation.

no gamez ... it looks like he is doing a mod installer
PhilG
Right, itīs the first time I build an installer for a mod, because the wav files took over 480MB.
The last version of the mod compressed as RAR had 275 MB, now built with the installer and MP3 it has only 100MB and contains over 600MB of data.
A bat wouldnīt work, because you can choose the directory during installation.
I donīt know how to put this information into the bat.
kalmark
You can pass parameters to batch files like if batch.bat contains
CODE
cd %1

then launching
CODE
batch.bat c:\destinaton

should change the current directory to c:\destination.
Google can give you quite a lot of help and examples on using batch files smile.gif
analogy
Any particular reason you can't just implement an MP3 decoder into the mod? Decoding a bunch of MP3s to WAVs seems like a huge waste of disk space.
PhilG
The game doesnīt support MP3 only wav and I donīt want to change the hardcoded things to keep compatibility with other mods.
Maybe the batch thing would work, but this had to be implemented differently to the installer script.
The way I did it is ok for me, the installer extracts all MP3 to the right folders, converts them to wav and is deleting the MP3 afterwards.
The only disadvantage is that it takes more time to install the mod.
poppy10
QUOTE
mkdir result
FOR %%a in (*.mp3) DO lame --decode "%%a" "result\%%a"
cd result
ren *.mp3 *.wav


This works well for me. It converts the mp3s to wavs and renames all the files correctly to *.wav instead of *.mp3
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.