Hi,
I am trying ti use the Lame4Dos.bat file to convert many .wav phone recordings to .mp3 and save some space. I have dowloaded the .bat file and edited the path to the Lame.exe and set my options. When I attempt to execute the batch file, I receive:
>& was unexpected at this time.
Here is my .bat filefor those who have never looked at it:
@echo off
rem ---------------------------------------------
rem PURPOSE:
rem - put this Batch-Command on your Desktop,
rem so you can drag and drop wave files on it
rem and LAME will encode them to mp3 format.
rem - put this Batch-Command in a place mentioned
rem in your PATH environment, start the DOS-BOX
rem and change to a directory where your wave
rem files are located. the following line will
rem encode all your wave files to mp3
rem "lame.bat *.wav"
rem ---------------------------------------------
rem C2000 Robert Hegemann
rem ---------------------------------------------
rem Changes to support long filenames using 4DOS
rem by Alexander Stumpf <dropdachalupa@gmx.net>
rem ---------------------------------------------
rem please set LAME and LAMEOPTS
rem LAME - where the executeable is
rem OPTS - options you like LAME to use
set LAME=c:\lame\lame.exe
set OPTS=-f
rem ---------------------------------------------
set thecmd=%LAME% %OPTS%
for %%f in (%&) do (%thecmd% %@sfn[%%f]^(ren %@sfn[%%f].mp3 "%@lfn[%%f].mp_">NUL))
ren *.mp3.mp_ *.new.mp3 >& NUL
ren *.wav.mp_ *.mp3 >& NUL
goto endmark
:errormark
echo.
echo.
echo ERROR processing %1
echo.
:endmark
rem
rem finished
rem
I am using XP Professional. Any help/suggestions is greatly appreciated.
Thanks,
Mark
@echo off
set LAME=c:\lame\lame.exe
set OPTS=-f
%LAME% %OPTS% %1 %1.mp3
ren *.wav.mp3 *.mp3
This will do the trick.
didnt test but instead:
for %%f in (%&) do (%thecmd% %@sfn[%%f]^(ren %@sfn[%%f].mp3 "%@lfn[%%f].mp_">NUL))
things should probably be:
for %%f in (%1) do (%thecmd% %@sfn[%%f]^(ren %@sfn[%%f].mp3 "%@lfn[%%f].mp_">NUL))
%LAME% %OPTS% %1 %1.mp3
ren *.wav.mp3 *.mp3
FYI: Minor improvement:
%LAME% %OPTS% %1 "%~dpn1.mp3"
If %1 is
"C:\My Music\My File.wav" then %~dpn1 is
C:\My Music\My File%LAME% %OPTS% %1 %1.mp3
... is just the same as:
%LAME% %OPTS% %1
shade, syntetic soul, yes but that wont work with 'lame4dos *.wav'.
minimum would be:
for /f "delims=++" %%i in (%1) DO lame --alt-preset standard "%%i"
@mark
it's not clear from your post, are you using 4dos or the xp command shell?