![]() |
Using dBpowerAMP and lame.exe - won't work
Around 2004 or 2005, I used a program called "dBpowerAMP" and also got the "Generic CLI Encoder" which uses lame.exe. When I first got it (referred to on these forums), I had trouble getting it to work as I get "codec error" every single time. I just tried it again and I get the exact same thing. Why is this? How do I fix it? No matter what I use, it's always the same result. I'm just trying to convert my WAV files to ABR MP3. To explain just how I'm doing it and what I'm trying to do, I took these 6 screenshots.
Screenshot #1 - I use the little program I have in the background to generate the WAV files (of which only the sample rate and "bytes per second" values are changed in each). The files play back in any program (Winamp included) without any problems so it's not the program or the files being faulty. To convert using the program I've had trouble with, I open it as shown in the foreground. There's nothing new here. Screenshot #2 - I open a file to try testing it with. I only need one file at the moment for testing. The details are shown in the screenshot of the one I chose. Screenshot #3 - Here, I'm choosing to locate the encoder, lame.exe in this case. Still no problems. Screenshot #4 - I put in the details I need. I want average bit rate of 24 Kbps (I'll fine-tune this later, likely from 12 Kbps to 32), I want high quality conversion, and I want the file to be resampled to 16,000 Hz, a standard sample rate compatible with MP3's. When done adding the command lines, I choose to convert. Screenshot #5 - At first the conversion seems to work as shown here, but, looks are deceiving. Screenshot #6 - After just 3/5 of a second or so, I get this, the error, and no MP3 file is even written at all. No matter what I do or how I change the command lines, even if I use a file with a standard sample rate (i.e. 48,000 Hz), it still happens. What can I do about this? |
uh... just use CD_ex?
|
What's CD_ex? Any idea about the error I'm getting with the other program? Does anyone else get it?
|
http://sourceforge.net/projects/cdexos/
I'm not familiar with those other programs. I use CDex and have for 6-7 years. |
I downloaded it and began looking at it. Unfortunately it won't let me use 16,000 Hz sample rates. It goes to 32,000 at the low end, way too high for what I need. 8000 is the lowest decent sample rate. I think you may not know my rather unusual needs (all of which Audacity supports), listed below in order from most important to least important:
1. It must support nonstandard sample rates (convert them to either 11,025 Hz, 16,000 Hz, or rarely, 22,050 Hz, my common standards - I'd use 8000 but my MP3 player doesn't play it back properly even with 64 Kbps CBR). Something like 19,583 Hz is certainly not a standard sample rate and neither is 35,782. This seems quite commonly supported. 2. It must not cut off the beginning and ending of songs. Many such converters tend to cut off the beginning half second and ending 3 or 4 seconds and this would cut off this amount of the song. Audacity doesn't do this. This, however, seems surprisingly common and may limit my choices quite well. My songs have been cropped so that they loop seemlessly without any "ticks", sudden pauses or skips. 3. It must be free and not have any trial effects on it. 4. It must be able to batch convert WAV to MP3. This seems quite common. 5. It must never convert my mono files into stereo files - it not only wastes space, but it significantly increases the distortions due to twice the amount of data needed increasing the Kbps value defeating the purpose). Only one program has had this issue, out of about 10 or so I've used. |
Lame.exe (3.97) accepts 25kHz files, so it's probably dBPowerAMP's fault.
See if another frontend works, or simply use cmd/a batch file/another little program. |
I tried using dBpowerAMP's built-in system and it converted just fine. I get an MP3 file of a gigantic size, much bigger than my current CBR values (then again, I haven't configured anything).
What do you mean by this: "See if another frontend works, or simply use cmd/a batch file/another little program." I'm confused about the part after the comma. |
I was referring to using lame.exe via command line (cmd.exe) like this
for %i in (*.wav) do [insert path to lame]\lame --abr 24 --resample 16 "%i" "%~ni.mp3" or making a batch file with the same content (except %% instead of %), or writing a simple app that calls lame (I was assuming you wrote that other program as well). |
Use the command line, use a batch file, or another pre-written utility.
|
I'm not that advanced in C programming yet. This was the first program of use to me. Programs like Winamp are well beyond my skills at the moment. I'd otherwise program this myself but I don't know how to use a DLL, what the parameters for the various functions are, or simply just how to use it. I've never made a batch file before nor have I seen the code for one. You left out one other detail - the directory to where the WAV files are. The format is always the same:
C:\My Documents\Songs for MP3\[name of song]\[speed] [name of song].wav An example of one is: C:\My Documents\Songs for MP3\Battle Zone\25000 Battle Zone.wav 25000 means half true speed (after 25000 ÷ 50000). As to the thing I use with start > run (for commands), wouldn't it be something like this: Quote:
|
Your path contains a space so you have to add quotation marks like this:
for %i in (*.wav) do "C:\My Documents\Special Programs\WAV to MP3 converter\lame\lame.exe" --abr 24 --resample 16 "%i" "%~ni.mp3" For a batch file simply paste above code in a text editor, replace % with %%, and save it with extension .bat in the folder you have your wavs in. Once you're finished with that folder, move it into the next one (since the path to your wavs changes depending on the song name it can't be specified in the batch file, so it always has to be in the folder of your wavs). The mp3s will be saved in the same folder with the same name as the source wav files. |
Knowing I could just toss all the source files into one folder then use a copy paste operation on the MP3's to place them in the folders for organization, then delete the MP3's and the speeds (My program generates the speeds in about a minute, writing at 55 MB per second - blazing fast. Plus, I could simplify the program a little further as well). Seeing a similarity, I'd suspect I'd have this:
Quote:
1. As with C programs, does a BAT "program" have to be compiled or is it interpreted (like javascripts)? 2. You left out the "-h" command line for high quality conversions. 3. Will this cause the songs to be cut off at the start and end of the track? Even a tenth of a second is too much. 4. Is there a way to allow for seemless looping playback of MP3's as if you copied and pasted the wave and played back the copies (causing no seam, gaps, pauses, etc.)? If there is, is this possible with lame.exe and this conversion? If it is possible, how do I do it (and this could really save on space since each track tends to contain 7 or so loops to get this feel with the least noticability of the reload gap)? Will the Creative MuVo2 MP3 player be able to play it back? |
You'll have to add the path to your output filename, otherwise the mp3s will be put into the batch file's folder:
for %%i in "C:\My Documents\Songs for MP3\source files\to convert\*.wav" do "C:\My Documents\Special Programs\WAV to MP3 converter\lame\lame.exe" --abr 24 -h --resample 16 "%%i" "C:\My Documents\Songs for MP3\source files\to convert\%%~ni.mp3" (Or you could also specify a different output folder of course.) 1. It doesn't have to be compiled. It will be interpreted by the shell, just as command lines typed into a console window (or DOS window in older Windows versions). 2. I'm not sure if -h still offers much of an improvement, HA's recommended settings also omit it. 3. Not that I know of (and I suspect it would lead to bug reports). 4. Yes, but only if the player supports lame's gapless tags (or the somewhat similar ones used by iTunes). By design mp3 doesn't support abritrary track lengths so in most cases there is some silence added at the end, and most if not all encoders also add some to the beginning (the so-called encoder delay). The player has to be told to skip those parts on playback, which (afaik) so far only works in Winamp, foobar, iTunes and iPods (and maybe Rockbox, but I don't think it's available for the MuVo anyway). |
I copied your code you gave, but it's not working. Here's what I did:
1. I created the folders making sure they were the same as in the path. 2. I copied your code you gave me, opened Wordpad, created a new text document (the kind without formatting), pasted the code into it, then saved the file as "WAVtoMP3converter.bat". 3. I move a test subject in there to see if it works, by copying a working file. 4. I opened Windows Explorer to get to the directory with the BAT file and double-clicked it. The command prompt window pops up so quickly I cannot read any of the text and it's extremely difficult to capture a screenshot to read it as 9 in every 10 tries is a miss and when I get a hit, it's blank, even though I'm seeing text in it. I'm beginning to suspect that it's lame.exe being problematic, despite downloading it a day ago from rarewares (release version, not the alpha version (alpha is even less stable than beta and beta preceeds a release version). Even the version I had since February of 2006 was the same way. So what could be wrong? |
Add a new line to the batch file containing the command "pause" (without quotation marks), then the window will stay open until you press a key.
Btw, the command above also has to be in one line, if wordpad messes that up maybe better use notepad (which also allows to easily switch off word wrap so it's easier to see whether it's one line or several). |
Adding "pause" without quotes on a new lines doesn't fix it either. No pause occurs as the window still flashes on screen for but 1 monitor refresh (1/60 second, part of the reason it's so hard to get a screenshot of). The code is indeed all on one line and to verify that, I held down a test key in the middle part of the line. If it were on multiple lines, a sudden break would occur after doing this. Of course, I deleted the extra characters returning the script back to the way it was again. Pause, too, is on another line as I can easily see the break. I see the bytes "0D 0A" in the hex edittor occurring only before the pause line and there's no other instance of it. Remove the pause line to what I had before, and this doesn't appear at all.
Edit: I finally managed to get a worthy screenshot, but part of the text is cut off. This is the screenshot. There appears to be script errors. This happened after another 30 attempts at getting the screenshot. |
Now I see the error: "C:\My Documents\Songs for MP3\source files\to convert\*.wav" has to be in parentheses ie.
for %%i in ("C:\My Documents\Songs for MP3\source files\to convert\*.wav") do... |
Yes!!! At long last I can use ABR. It plays in my MP3 player just fine. Now to find the optimal Kbps value - time for some more experimenting. Thank you so much! Even with 12 Kbps for ABR, I still really can't detect that much of a difference to the original, about 112 or 96 Kbps for CD-quality music (in terms of the lossy effects from MP3 anyway). Then again, it may be that I'm playing a rather slow speed (just under 62% true speed) and thus doesn't have all the high-pitched sounds. Experiments will answer the last of my questions, questions you won't be able to answer.
PS I like the Kbps value distribution chart that shows up. |
http://www.dbpoweramp.com/codec-central-mp3-lame.htm
http://www.geocities.com/gameplaya_1...dmc/index.html To use abr just put "--abr XX" in the box. Enjoy :cool: |
I've tried the use of dBpowerAMP with the generic CLI encoder. All I get is just a "codec error" error message no matter what I do. By using the BAT file gaekwad2 kindly provided, I'm able to use it and that's all I need. There's more than just using ABR though. It needs to be resampled since the sample rates of the source WAV files are all over the place and always include nonstandard ones (like 32917 Hz or 73750). The codec may not be able to encode these at all (and you can see this in my screenshots on the first post of this thread).
I spent 2 days reprocessing my songs. Although I stated 12 Kbps was the point of no distortions, there were a lot, but impossible to detect over my noisy CPU fan. It was once I tranferred the test subjects to my MP3 player and turned off my computer that I got to hear the distortions. 18 Kbps was the point where they vanished so I began using 21 Kbps to cover a possible offset some songs may have. I later on wanted to use 12 KHz sample rate instead of 16 KHz so I had to rerun some of my experiments. My theory predicted I could go with 15.75 Kbps (rounded to 16) for the same basis as 21 for the 12 KHz sample rate (3/4 the data, 3/4 the bit rate). For that, I just saved the BAT file under another name dedicated for the 12KHz versions, used for songs that have little or no effect with frequencies 3KHz and above (due to a bug in the MP3 player where it plays back about 2/3 as fast, I have to speed up the song to counter this which causes it to play back as if it had a 8000 Hz sample rate). Yep, now to reprocess some songs again. |
| All times are GMT. The time now is 20:36. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.