Skip to main content
Topic: Lame4Dos.bat (Read 3975 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Lame4Dos.bat

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:

Quote
>& was unexpected at this time.


Here is my .bat filefor those who have never looked at it:

Quote
@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

Lame4Dos.bat

Reply #1
Code: [Select]
@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.

Lame4Dos.bat

Reply #2
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))
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Lame4Dos.bat

Reply #3
Quote
Code: [Select]
%LAME% %OPTS% %1 %1.mp3
ren *.wav.mp3 *.mp3

FYI: Minor improvement:

Code: [Select]
%LAME% %OPTS% %1 "%~dpn1.mp3"

If %1 is "C:\My Music\My File.wav" then %~dpn1 is C:\My Music\My File


Code: [Select]
%LAME% %OPTS% %1 %1.mp3

... is just the same as:

Code: [Select]
%LAME% %OPTS% %1
I'm on a horse.

Lame4Dos.bat

Reply #4
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"
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

 

Lame4Dos.bat

Reply #5
@mark
it's not clear from your post, are you using 4dos or the xp command shell?

 
SimplePortal 1.0.0 RC1 © 2008-2019