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: Searchpath using lame.exe (Read 3280 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Searchpath using lame.exe

Is it possible to have an infile which is placed in another folder than lame.exe is located. In that case how?? (There must be)
lame --abr 24 /../songs/file1.mp3 /../losongs/newmp3.mp3

This works for the ouput but not the input since lame says it can´t find it. What I wan´t is to take the file file1.mp3 which is located in c:\songs and convert it and put it in c:\losongs.

Searchpath using lame.exe

Reply #1
Where was your command prompt when you tied it? - You wrote:
lame --abr 24 /../songs/file1.mp3 /../losongs/newmp3.mp3
This dot-dot-notification indicates relative paths. I guess this is accitentally!?

However, i have made a test with absolutely indicated paths:
X:\>Lame3961.exe --abr 24 "E:\Test-In\Rythm.wav" "F:\Test-Out\Rythm.mp3"
This works fine. Only take care that input and output folders exist.

Even exactly this here works (slash or back-slash don't matter):
X:\Test>Lame3961.exe --abr 24 "/../Test-In/Rythm.wav" "/../Test-Out/Rythm.mp3"
This time Test-In and Test-Out folder are on the same drive where the Lame command was started, so on X: both.

Not what...?  What's the exactly error message you get?


[some minutes after...]

Ok... What i have found out: Lame v3.90.3 ("stable bundle 2004-02-10" and "Modified bundle 2004-02-06") don't work correctly on the two example above if you use slashes/ instead of back-slashes\  Otherwise Lame says: Could not find "E:Rythm.wav" (or "Rythm.wavIn/Rythm.wav" for realtive paths).
This is really strange because i have found also to a (older?) Lame 3.90.3 compilation that works fine with slashes like v3.96.1 it does.


So simply use good old Windows back-slashes or to take Lame 3.96.1, moreover i could imagine it's even the better choice for low-quality (correct me please if i'm wrong here) since most Lame 3.90.3 compilation are preset-tunned for standard, extreme and maybe medium.
If You wan't to use Lame 3.90.3 nethertheless make a post and i will try to pass You the one i used successfully.

Searchpath using lame.exe

Reply #2
Ok, thanx I see. Understand how to use it know. Also downloaded the newest version.

Now I have another problem. When I´m tryng to launch lame.exe from a JAVA-program I´m writing  lame isn´t working correctly.

This is how I call the program in JAVA:
Process proc = Runtime.getRuntime().exec("lame --abr 8 songs\\"+children[j]+ " /../Program/ApacheGroup/Apache/htdocs/musicmaker/losongs/"+children[j]+ "");

The problem is that lame starts but don´t do anything...until I close the JAVA-program. When I´ve closed the JAVA-program lame.exe starts working with the file but quits after just a few seconds. The resulting mp3-files becomes a 1 minute sample of the original which was 3 minutes. Any idea why? And how to solve this.

Searchpath using lame.exe

Reply #3
Sorry i have absolutely no idea about calling an external program by Java.
By the way, you need a external Java program to encode samples/clips/streams you need for your own Apache server?

Searchpath using lame.exe

Reply #4
Yes, that´s what I need ! any ideas?

Searchpath using lame.exe

Reply #5
So, only to prevent missunderstandings, your Java is not a part of your Apache server? I mean - if i'm not fully wrong - there does exist something like server-sided Java too!?

However, if your Apache installation e.g. supports pearl or php (as cgi or module) you can Apache do the encoding-work you need. I'm quite sure there are commands to call external programs directly.

This would be a very efficent way - but won't change the cruel mp3 quality at around 30kbps. I guess nobody will call it pleasure to listen to for minutes, rather save encoding time. Moreover take note that you get maybe legal troubles when publishing more than 30 sec.
I guess here in the forum were already lo-fi tests...!? - For my own use i took once this:
Lame395.exe --preset 32 -a -m m --resample 16 --lowpass-width 1 --quiet
Lame392.exe --abr 32 -a -m m --resample 16 --lowpass 7.5 --lowpass-width 1 --quiet
Stereo encoding and a resampling rate donw to 22kHz seems to be the default but make the clips even worse for my taste - there are just not enough bits to store all that data. In order not to get a too variable bandwidth use you also may add '-b 16 -B 56'. Newer Lame versions above 3.93 (but also 3.90.3) are smart enough to handle the lowpass filter, for older versions you better set it manually. It would generally be good idea to test older Lame versions, they are quite different in quality and speed.


But in my opinion You get the 'best' quality with Wma at such low kbps-rates (although this will cause problems for Linux and even maybe Apple users).
If also 50-60kbps is ok, Ogg gets very attractive.

Searchpath using lame.exe

Reply #6
First of all..thanx for taking your time  Should keep your advice about the mp3-quality in mind when I finalize my work. Right now I´m in a testing phase where the most important thing is to get the "programs" running together.

The JAVA-program I´m working with has nothing to do with the server side. I had no idea apache was able to code mp3´s, or what do you mean? You´re saying that Apache itself could call lame? How should I then tell Apache when to do this?

My first solution to the whole problem was to call lame directly from PHP. But that didn´t work quite well. In fact had the exact problem as I have now when using a external JAVA program which has no connection at all to the server. (the mp3´s becomes shorter than the original. 3 minutes becomes 1 minute.)

If you have any other solution to my problems, please let me know!

Searchpath using lame.exe

Reply #7
I have no doubt Java is powerful enough to to that job too. But if you had already the intension to do it with Apache/PHP i would relaunch your tries. If you have a fast server and not too much clients to serve you could even do the sample encoding on-demand, specially for tracks that don't follow the mainstream taste.

<?php
$input = "I:\\in\\orig.wav" ;      // may also be an MP3 specially when using Lame
$output = "O:\\out\\orig.sample.mp3" ;
$cmd = "E:\\exeBin\\Lame.exe --preset 32 --quiet \"$input\" \"$output\"" ;
echo $cmd . "<br>\n";
exec($cmd) ;
if (@filesize($output)) echo "File \"$output\" encoded successfully!";
else echo "Damn, it was't able to encode \"$input\" to \"$output\"!";
?>

Take note that Lame won't create itself output folders. If you call any example like above within a loop you should ensure that the server doesn't run out the execution time, so better encrease the variable 'max_execution_time' in your php.ini (i guess there are also any php-commands to influence this!?).


Indifferently if you use Java or PHP newer Lame versions report a Replaygain level that is a very interesting information for further use with mp3gain in order to reach a similar loudness for all the samples.