I have been doing some work for a musician and needed to convert a batch of MP3 files to the open source OGG format. At first I went down the route of creating my own bash script that loops through the directories and converts each file in turn. I then discovered the dir2ogg application.
Dir2ogg is a python script that can convert MP3, WAV and MP4A files to the OGG format. You can supply the -r flag which will make dir2ogg descend recursively into sub directories and convert any valid files that it finds. The application will create an OGG file with the same name as the target file and you can you use the -c flag to target an audio CD.
To download dir2ogg simply type the following in a terminal under Linux (I’m using Ubuntu)
apt-get install dir2ogg
To run the dir2ogg type the following in a terminal:
dir2ogg -r /my-folder-full-of-mp3s
The above will convert any mp3 files within the folder /my-folder-full-of-mp3s and any sub directories that it contains.
I recommend going through the man pages as there are some clever flags that you can pass to the dir2ogg application that cater for compression rates and so forth.