You can use the open source ffmpeg program to convert a media file from one format to another.
Below is an exmple:
[shellprompt]# /fullpath/to/ffmpeglibrary/ffmpeg -i InputFile.FLV OutputFile.mp3
There are various other options you can use to specify the attribute of the output file.
Here are few of the examples code http://linuxers.org/book/export/html/593
Vinod Ram has been in Software Industry since 2006 and has experience of over 16 years in Software Development & Project Management domain specialised majorly in LAMP stack & Open Source Technology, building enterprise level Web based Application, Large Database driven and huge traffic Websites and Project Management.
He loves to write information articles and blog to share his knowledge and experience with the outside world and help people to find solution for their problems.