Page 1 of 1

How to convert mp3 to different audio formats

Posted: Fri Jul 11, 2008 3:59 am
by dayak
Hi,

For days now, I'm searching for solutions to convert mp3 files to aac, amr, mmf and wav formats.
I've seen numerous programms (whit GUI's) that convert but I want to convert them in a batch with PHP functions or JavaScripts.

Can someone point me in the right direction?

Any help is much appriciated.
dayak

Re: How to convert mp3 to different audio formats

Posted: Sun Jul 13, 2008 7:24 am
by vargadanis
JavaScript won't do it. It is absolutely not designed for that. Not a chance...

With PHP you might be able to do it if the server have the proper libs installed. If it is your own, you should have no problem. I think your best shot is trying to write a bash script which will be executed by PHP or even as FastCGI (or just regular CGI).
For conversion, there are tons of libs for linux. One of the better ones is ffmpeg or you could use mplayer for making modifications. They both rock. Mplayer is a Hungarian project (I am Hungarian as well :) ).
So in steps:
  • upload the file to convert
  • execute script that converts
  • download the file
take a look at this: php.net/exec

Bests