Skip to content

Instantly share code, notes, and snippets.

@piffy
Last active May 1, 2016 08:51
Show Gist options
  • Save piffy/9d2be7c0a424e40561be3cc115ff6dc1 to your computer and use it in GitHub Desktop.
Save piffy/9d2be7c0a424e40561be3cc115ff6dc1 to your computer and use it in GitHub Desktop.
#!/bin/bash
current_directory=$( pwd )
#remove spaces
for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done
#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $i && lame -m s audiodump.wav -o $i; done
#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment