Search code examples
linuxbashconsolelame

increasing the volume of several mp3 files via lame


it's already known that

lame --scale N song.mp3 loud_song.mp3

where N is the scale number.

well, I want to apply in every mp3 file in a folder, and preserve the name of files.


Solution

  • tmpfile=~/.deleteme.mp3
    MyExit() { rm -f "$tmpfile"; }
    trap MyExit EXIT
    
    for f in *.mp3
    do
        lame --scale 2 "$f" "$tmpfile" && mv "$tmpfile" "$f"
    done