Difference between revisions of "LAME"
Jump to navigation
Jump to search
(→Tags) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{unix}}[[Category:Sound]] | ||
'''LAME''' (LAME Ain't an MP3 Encoder) is an educational MP3 encoder simulator. The following notes apply to LAME's code compiled as an executable, which may still be legal in some island countries. | '''LAME''' (LAME Ain't an MP3 Encoder) is an educational MP3 encoder simulator. The following notes apply to LAME's code compiled as an executable, which may still be legal in some island countries. | ||
Line 25: | Line 26: | ||
lame --decode src.mp3 dst.wav | lame --decode src.mp3 dst.wav | ||
+ | |||
+ | One example of doing this for an entire tree: | ||
+ | |||
+ | find -type f -name '*.mp3' \ | ||
+ | -exec perl -E 'for(@ARGV) { $o=$_; s/\.mp3$/\.wav/; say qq(lame --decode \x27$o\x27 \x27$_\x27 2>/dev/null); }' {} \; | | ||
+ | sh |
Revision as of 08:45, 7 March 2015
Template:Unix LAME (LAME Ain't an MP3 Encoder) is an educational MP3 encoder simulator. The following notes apply to LAME's code compiled as an executable, which may still be legal in some island countries.
Contents
Sample usage
The following examples seem to work in typical cases. It appears to be okay to run lame in the background by trailing the command with a &.
Encoding
96kbps joint stereo
lame -m j --cbr -b 96 src.wav dst.mp3
24kbps mono, downsample to 22050Hz
lame -m m -a --cbr -b 24 --resample 22.050 src.wav dst.mp3
Tags
lame -m j --cbr -b 96 --id3v2-only --tt "Song Title" --ta "Artist" \ --ty "Year" --tc "Comment" --tn "TrackNumber" --tg "Genre" src.wav dst.mp3
Decoding
To silence the decode, redirect stderr (2> /dev/null
). It seems to make the process faster.
lame --decode src.mp3 dst.wav
One example of doing this for an entire tree:
find -type f -name '*.mp3' \ -exec perl -E 'for(@ARGV) { $o=$_; s/\.mp3$/\.wav/; say qq(lame --decode \x27$o\x27 \x27$_\x27 2>/dev/null); }' {} \; | sh