I have my CD collection stored on harddisk for easy access. I used the Ogg-Vorbis compression because it uses a free algorithm, and (while I have no possibility to verify this) people say the files are better quality.
But for some things, I need MP3 files. Especially for a set of about 20 CDs, I chose to create MP3s, so I could listen to them on a regular MP3-player. I encoded the files using Grip and the lame-encoder, which worked just fine for the first half of the CDs. Then I took a break, bought a new CD, stored that on HD using OGG, and forgot to reconfigure Grip to make MP3s when I continued with that pack of 20…
I once had a windows-freeware that would convert OGG to MP3. But when I looked for it, I could not find it on the web anymore. There was plenty of shareware to do the task. And while I am not against paying for software, I really think twice before spending money on something I will only use once and does not run on my favorite OS.
After reading ‘man lame’ and ‘man oggdec’ I found the solution available freely (as in beer and as in speech) on my harddisk:
jjw@dvd-station:~$ find ./ -iname "*.ogg" -exec oggdec {} \;
jjw@dvd-station:~$ find ./ -iname "*.wav" -exec lame {} {}.mp3 \;
jjw@dvd-station:~$ mmv "*.wav.mp3" "#1.mp3"
jjw@dvd-station:~$ rm *.ogg *.wav
The first command find all OGG-files and converts them into WAV. The second command finds all WAV-files and converts them into MP3. The third command renames all results of the second command (which end in “.wav.mp3”). The last command deletes all OGGs and WAVs.
This approach above uses tons of disk-space. With a small shell-script, it is possible to do it without these extra-megabytes.
I used this when I had to convert about 12GB of *.ogg (almost all of my CD-collection) to MP3s in order to carry some of it on the MP3-player (and SD-Cards that fit into it) along during vacation.
This is the script ‘ogg2mp3’ which takes the file to be converted on the command-line:
#! /bin/bash oggdec "$1" -o - | lame -b96 - "$1.mp3"
Note that the ‘-b96’ option causes lame to reduce the quality to 96 kbps (which I chose for saving space on the MP3-player.)
The command now is:
find ./ -iname "*.ogg" -exec ogg2mp3 {} \;
# Concatenate MP3s without recoding # http://mp3wrap.sourceforge.net/ mp3wrap complete.mp3 many-trackes-*.mp3 # Recode to 56 Kbps for less memory-usage on MP3-Players for m in *.mp3 ; do lame -b56 $m ../56kbps/$m ; done # Filling MP3-Tags automatically # http://easytag.sourceforge.net/ /opt/gnome/bin/easytag &
Created by stwaidele
How about a script that takes care of it. It does not delete the original mp3 unless you set it to do that. It does delete the wav that is created along the way. It does recursive. You could write it with a sort of reverse of the ogg to mp3, but here it is all ready to go. This software is copyrighted by Fredrik Lindroth and is called dirogg: http://home.student.uu.se/frli4865/software.php
Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.
Linux® is a registered trademark of Linus Torvalds.