Need an automatic mp3-conversion script, probably using Lame

I need to have a function on my website which takes high quality mp3s and convert them into low quality mp3, made for streaming. The process should take place automatically when a new mp3-file is uploaded.

Ive begun working with lame but I cant get it quite right. The lame.exe works fine when I start the application manually in a command-promt window (WIN XP). But when I try to call the program from a PHP-script the mp3-conversion stops after just a few seconds:

$bitrate = 48;
exec("lame -a --mp3input --resample $bitrate hej.mp3 12.mp3");

If I write that code directly to lame in a command prompt window it works fine, the conversion completes. But as I said, when I try to do the same thing from PHP it stops before the conversion is finished.

Ive checked the php.ini and its not the time for how long a a script can "act" which is too short. So what can it be?

I also need a way to close down lame.exe after the conversion is complete. Otherwise new lame.exes will be started each time I call the program from my PHP-script.

If anyone have any ideas I would be grateful!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!