Created
May 13, 2009 17:48
-
-
Save c9s/111156 to your computer and use it in GitHub Desktop.
this script convert m4a audio file to mp3 file
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 characters
#!/bin/bash | |
input=$1 | |
if [[ -z "$input" ]] ; then | |
echo "Usage: $0 [m4a filepath]" | |
exit | |
fi | |
if [[ -z $(which faad) ]] ; then | |
echo "Can not found faad , please install it" | |
exit | |
fi | |
if [[ -z $(which lame) ]] ; then | |
echo "Can not found lame , please install lame" | |
exit | |
fi | |
noext=$(echo $input | sed -e 's/.m4a$//g' ) | |
faad -w "$input" > "$noext.wav" | |
# -r : for assume raw pcm data | |
# -V : for varialbe rate | |
lame -r -h -V 6 "$noext.wav" "$noext.mp3" | |
# lame -h -b 64 "$noext.wav" "$out.mp3" | |
rm -v "$noext.wav" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment