Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Hack lame.exe to change default settings (Read 5132 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Hack lame.exe to change default settings

I am using the RadioDJ Altacast plugin to feed my stream audio through LAME and combine it with title information before sending that load to our Shoutcast server. In general, I couldn't be happier with the result. The only thing is, the standalone Altacast has an advanced tab where options like q0 can be specified, and this plugin one does not. I am dissatisfied with the output quality of q 5 (the default of LAME 3.99.2.5 according to its built-in help information) and I am unable to change it because I cannot modify the command being passed to LAME.

I have tried everything. If I create a wrapper script to pass an additional option to lame.exe the plugin thinks that LAME isn't working. I used the syntax "lame.exe -q0 %1 %2 %3 ....... %9" and perhaps my syntax is off, but I suspect that the problem is the lack of errorlevel feedback.

I am sure that the default value could be changed in a hex editor, but I'm not clever enough to figure out exactly what to change. I would like to change the default to q0, but if I have to force q0 even if commandline says otherwise, so be it. Perhaps that would be best, actually, as this is a copy of LAME not used for any other applications.

Can someone who is better than I am at reverse-engineering code PLEASE tell me what to change to force this setting?

Hack lame.exe to change default settings

Reply #1
The default setting is -q 3, not -q 5  (some documentation is wrong. You can check it if encoding and looking at the window, it will say qval=3).

Since you are streaming, I assume you're using CBR (or ABR at much), because in VBR, it wouldn't matter at all (VBR doesn't have as much levels, and q3 equals to q0). In some frontends, there's also the "high quality" option. That maps to -q 2.

Now, I would like to understand what does "dissatisfied" mean. Which is the target bitrate? The input is lossy or lossless? Do you have any example files where q 3 vs q 0 is audibly problematic?

Hack lame.exe to change default settings

Reply #2
You don't have to reverse engineer anything.  You can grab the source code and change the command line options to whatever you like.  However, this is probably not necessary if all you are concerned about is the -q setting, which actually doesn't do very much for your purposes.

Hack lame.exe to change default settings

Reply #3
The LAME executable reads the LAMEOPT environment variable and puts its contents infront of any specified program arguments. Try specifying your additional settings there.

Hack lame.exe to change default settings

Reply #4
The LAME executable reads the LAMEOPT environment variable and puts its contents infront of any specified program arguments. Try specifying your additional settings there.


Ah! Yes! This is truly helpful! I will definitely investigate that! Yes, I am using CBR, and recompiling LAME is not something that I feel up to at this time—I can do it in Linux, but Windows is a different beast altogether.

Thank you for your help! I guess I forgot to enable email notification or something, because I didn't know anyone had replied.