You’ve conscientiously imported your entire CD collection into the free Ogg Vorbis format but now you have an mp3 player or cell phone that won’t handle .ogg files. Instead of getting out your CDs and importing them into mp3s, Ubuntu has many tools for converting ogg to mp3. The following tools are just two options, but I chose them because of their ease of use, and for the fact that they can convert directly from ogg to mp3 with no additional steps. To give them a try, just download them from the Synaptic package manager or with the apt utility.
Sound Converter is a graphical tool that uses gstreamer as its back end. It can read Ogg Vorbis, AAC, MP3, FLAC, WAV, AVI, MPEG, MOV, M4A, AC3, DTS, ALAC, MPC, Shorten, APE, SID and can convert them to WAV, FLAC, MP3, AAC, and Ogg Vorbis files. The nice thing about the software is that you can convert entire directories at one time.
Simply, open the preferences window and choose "MP3 .mp3" from the format drop down list. Then add your .ogg files and click convert. That’s it, you’re done.
If you prefer command line tools, or want more control over your conversion, give ffmpeg a try. ffmpeg is designed for video conversion, but it converts audio quite nicely as well. The basic command for ffmpeg is "ffmpeg -i example.ogg to example.mp3". It only converts one file at a time, so wildcards are out of the question. In order to convert large quantities of .ogg files you must use the following small script:
for x in *.ogg; do ffmpeg -i "$x" "`basename "$x" .ogg`.mp3"; done
If you want to change the bitrate of the output file, use the "-ab" switch. There are many more options for ffmpeg, both for audio and video conversion so check out the man page if you want even more control.
If you read the forums, or search for conversion tools, everyone will have a different opinion as to how to convert your files. These are my personal favorites, and are available from the default Ubuntu repository.