Code: Select all
convert () { mplayer -cache 32 -ao pcm:file="${file[x]}".wav"${file[x]}".ra; lame -V2"${file[x]}".wav"${file[x]}".mp3; } ; find"$My_Music" -iname"*.ra" > Musiclist.txt ; y=$(sed 's@ @\\ @g' Musiclist.txt | wc -l); ((y=y+1)); typeset -i x; x=1; while ((x < y)) && path[x]=$(dirname"$(awk NR==$x Musiclist.txt)") && file[x]=$(awk -F"/" -v line=$x 'NR==line{sub(/\..*/,"",$NF);print $NF}' Musiclist.txt) && ln -s"${path[x]}/${file[x]}".ra"${file[x]}".ra; do ((x=x+1)); done ; x=1; while (( x < y )) && convert; do (( x=x+1)); done; rm -vf *.wav *.ra Musiclist.txt ; x=1; while (( x < y)) && mv -v"${file[x]}".mp3"${path[x]}"; do ((x=x+1)); done
Code: Select all
export My_Music="/path/to/your/music/directory"