for f in *.mp3; do
mpg321 "$f" -w - | oggenc -o "${f%.*}.ogg" -;
done;
Notice the subtle use of Bash pattern matching and manipulation...yeah yeah yeah, come on guys, it's not about lossy and/or non-lossy conversion, it's about the funky pattern matching abilities in Bash. Do the words 'dirname' and 'basename' come to mind perhaps??? And how cool it is that you don't need them in a Bash script? And how much faster that is if you need to do a lot of files??? :-)
9 comments:
I count three lines, not one :P
Mmm... yummy quality degradation ;)
what about tags?
That's the main issue that keeps away from switching format.
A stupid thing to do. Quality loss hooray!
@quality degradation => There are some situations in which the pain of using MP3 is worse than the pain of quality degradation. Some people have lower pain-tolerance-thresholds than others :)
Don't use ls.
You can simply do
for f in *.mp3;...
Reason behind this is redundancy, and yours won't work on files with spaces in the name...
I find the ${f/%.mp3/.ogg} syntax easier. You should also use "" around the old and new names.
Another problem, which could arise: filenames which start with -
http://jensrex.net/bin/heehee.ogg
(The Transcode Song)
Boy do i need to see this kind of bad blogs on dot.kde Planet Developer. make a filter
Post a Comment