Skip to content

Instantly share code, notes, and snippets.

@SmugZombie
Created November 25, 2019 21:32
Show Gist options
  • Save SmugZombie/804eb522c6369e1bd0154570b90896c5 to your computer and use it in GitHub Desktop.
Save SmugZombie/804eb522c6369e1bd0154570b90896c5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Loops through the current directory looking for .mp3 files, converts them to wav files and cleans up the current directory
# Ron Egli - Github/smugzombie
# Create a place for the Originals
dir1="mp3"
dir2="wav"
if [[ ! -e $dir1 ]]; then
mkdir $dir1
fi
# Create a place for the new Wav files
if [[ ! -e $dir2 ]]; then
mkdir $dir2
fi
for i in $(ls *mp3)
do
base=$(echo $i | awk -F '.mp3' {'print $1'})
mpg123 -w $base.wav $i
mv $i $dir1
mv $base.wav $dir2
done
#mpg123 -w 1needa.wav 1need.mp3
#mpg123 -w 1needb.wav 1need-2.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment