How to convert mp3 to different audio formats

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dayak
Forum Newbie
Posts: 1
Joined: Fri Jul 11, 2008 3:31 am

How to convert mp3 to different audio formats

Post 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
User avatar
vargadanis
Forum Contributor
Posts: 158
Joined: Sun Jun 01, 2008 3:48 am
Contact:

Re: How to convert mp3 to different audio formats

Post 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
Post Reply