Help - Search - Members - Calendar
Full Version: Need help with LAME syntax w/ spaces in filenames
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
jerryfreak
I need some assistance with a script I use to convert tagged flacs to tagged mp3s. it works fine, except LAME chokes on filenames with spaces.

the actual batch files I'm using are located here:

http://tapergeek.org/FLAC-Transcoder-0.92b.zip

here is the part I am having problems with:

in 'flac>mp3' mode, right clicking a folder runs the following command:

for %%I in (*.flac) do call encode.cmd "%%I"


it then gets to the encoding portion of encode.cmd (below) and crashes on filenames:


:MP3
rem :Encode and tag the new file.
for %%I in (%1) do flac -d -c %%I | lame - --alt-preset standard --id3v2-only --pad-id3v2 --ta "%artist%" --tt "%title%" --tl "%album%" --ty "%date%" --tn "%tracknumber%" --tc "%comment% - Source: %sourcemedia% -transcoded directly from FLAC files to mp3 (LAME 3.90.3 -aps) using FLAC Transcoder 0.92" "%artist% - %album%.%ext%f"\%%~nI.%ext%"
goto END

for a filename with spaces, it always says 'lame excess arg: (second part of filemame).

in other words 01 - Divided Sky.flac, it would say 'lame excess arg: Divided'

any help here? thanks in advance!
kjoonlee
For one thing, the number of " double quotes is not even.

"%artist% - %album%.%ext%f"

\~nI.%ext%"
jerryfreak
QUOTE (kjoonlee @ Dec 6 2005, 12:07 AM)
For one thing, the number of " double quotes is not even.

"%artist% - %album%.%ext%f"

\~nI.%ext%"
*



Tried the following:
adding a quote before ~nI.%ext%
result - doesnt work on any files, even with proper file names

removed the extra double-quote after ~nI.%ext%
result - same operation with normal filenames, still doesnt work with spaces
jerryfreak
QUOTE (jerryfreak @ Dec 6 2005, 12:32 AM)
QUOTE (kjoonlee @ Dec 6 2005, 12:07 AM)
For one thing, the number of " double quotes is not even.

"%artist% - %album%.%ext%f"

\~nI.%ext%"
*



Tried the following:
adding a quote before ~nI.%ext%
result - doesnt work on any files, even with proper file names

removed the extra double-quote after ~nI.%ext%
result - same operation with normal filenames, still doesnt work with spaces
*




thats def. the part where it is crashing. If I replace the outfile location with

"%artist% - %album%.%ext%f"\test.%ext%

it works fine. so how do I get the filenaming syntax to work correctly? we're trying to take filename with spaces.flac to filename with spaces.mp3
jerryfreak
still need help with this - anybody?
jerryfreak
still need help with this - anybody?
Shade[ST]
1. don't bump your own threads, or others for that matter. It is very badly accepted by any community forum.

2. How about you give us an example command that actually crashes / crashed? Insert a "pause" in your program, and make sure echoes are on, and post here when you have useful info. Complex batches are very hard to diagnose, due to the mess that is the DOS shell.
Synthetic Soul
QUOTE (jerryfreak @ Dec 6 2005, 06:32 AM)
QUOTE (kjoonlee @ Dec 6 2005, 12:07 AM)
For one thing, the number of " double quotes is not even.

"%artist% - %album%.%ext%f"

\~nI.%ext%"
Tried the following:
adding a quote before ~nI.%ext%
result - doesnt work on any files, even with proper file names

removed the extra double-quote after ~nI.%ext%
result - same operation with normal filenames, still doesnt work with spaces

I think it should be:

CODE
"%artist% - %album%.%ext%f\%%~nI.%ext%"

(quote removed after "%ext%f")
jerryfreak
sorry to bump (twice was by accident-doh!)

that seemed to have worked, shade, thanks! I new it was a simple syntax issue
Synthetic Soul
Nobody appreciates me... sniff. crying.gif
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-2009 Invision Power Services, Inc.