Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Music Conversion (MP3 to WMA and WAV to MP3)
find . "(" -iname "*.mp3" ")" -print0 | xargs -0 -I file mv file "../music/$file"
find . "(" -iname "*.wma" ")" -print0 | xargs -0 -I file ./convert_file file
echo "$1"
mkdir -p "../music/${1%/*}"
ffmpeg -i "$1" -ab 320k "../music/${1%.wma}.mp3"
# Converts a collection of *.wav files and stores them in the rehearsals folder.
if [ -z "$1" ]; then
echo "Please enter a path where the .wav files are located"
exit 1
echo "Converting all *.wav files in $@"
find "$@" "(" -iname "*.wav" ")" -print0 | xargs -0 -I file ./convert_song file
# Converts a single .wav file and stores it in the rehearsals folder.
yesterday=$(date -v-1d +%F)
mkdir -p "./$yesterday"
song=$(basename "$1")
echo "Converting: '$song'"
ffmpeg -i "$1" -vn -ar 44100 -ac 2 -ab 320k "./$yesterday/${song%.wav}.mp3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.