Created
December 28, 2011 12:12
Revisions
-
cstroie created this gist
Dec 28, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ #!/bin/bash # # recode # # Copyright 2011 Costin STROIE <costinstroie@eridu.eu.org> # # recode is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # recode is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with recode. If not, see <http://www.gnu.org/licenses/>. # # Recode audio files WAVDIR="wav" MP3DIR="mp3" M4ADIR="m4a" # Create dirs [ -d "${WAVDIR}" ] || mkdir "${WAVDIR}" [ -d "${MP3DIR}" ] || mkdir "${MP3DIR}" [ -d "${M4ADIR}" ] || mkdir "${M4ADIR}" for F in *.mp3 do BN=`basename "$F" ".mp3"` WAV="${WAVDIR}/${BN}.wav" MP3="${MP3DIR}/${BN}.mp3" M4A="${M4ADIR}/${BN}.m4a" # Decode madplay -o "${WAV}" "${F}" # Normalize normalize-audio -v "${WAV}" # Encode to MP3 lame --preset standard "${WAV}" "${MP3}" # Copy the ID3 tags id3cp "${F}" "${MP3}" # Encode to M4A faac -w -s -o "${M4A}" "${WAV}" # Remove the WAV file rm -f "${WAV}" done # vim: set ft=sh ai ts=2 sts=2 et sw=2 sta nowrap nu :