audio uploader that converts to MP3

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
User avatar
Ju-Pao
Forum Newbie
Posts: 9
Joined: Wed Feb 21, 2007 3:44 am

audio uploader that converts to MP3

Post by Ju-Pao »

I would like to make a PHP code that uploads an audio file and converts the file to mp3 before saving in the disk... can anyone suggest a tutorial or functions that can help me in my problem?

thanks for the notice :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I believe you'll need a library or command line function (like "lame") to encode the file to mp3.

As for uploading in php.. http://php.net/features.file-upload
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I'm not sure what lame's licensing terms are for things like this. I know applications can't bundle the lame encoder with them (at least, they couldn't a few years back). You might wan't to look into that.

EDIT | Also, rather than using exec() or similar, you'll probably want to use proc_open() so you can detect failures and read from stdin/stdout/stderr.
User avatar
Ju-Pao
Forum Newbie
Posts: 9
Joined: Wed Feb 21, 2007 3:44 am

Post by Ju-Pao »

thanks for the reply guys :D
Post Reply