Skip to content

Instantly share code, notes, and snippets.

@fredmajor
Created December 18, 2017 20:20
Show Gist options
  • Save fredmajor/e64f2ffddfccf2a7cb9fc8134eea46c1 to your computer and use it in GitHub Desktop.
Save fredmajor/e64f2ffddfccf2a7cb9fc8134eea46c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
BITRATE="128k"
SAVEIF=$IFS
IFS=$(echo -en "\n\b")
for file in $(ls *mp3)
do
name=${file%%.mp3}
outname="${name}_${BITRATE}.mp3"
echo "converting $file -> $outname"
ffmpeg -i "$file" -c:a libmp3lame -b:a "$BITRATE" "$outname"
# lame -V0 -h -b 320 --vbr-new $name.wav $name.mp3
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment