Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Convert anything mplayer can play to low quality MP3
- IFS="
- "
- for file in $*; do
- if [[ -f "$file" ]];
- then
- filename=$(basename "$file")
- extension=${filename##*.}
- filename=${filename%.*}
- filenoext=${file%.*}
- wav="$filenoext.wav"
- mp3="$filenoext.mp3"
- echo "Converting ${filename}.${extension} to MP3"
- mplayer -vo null -vc null -af resample=44100 -ao pcm:waveheader "$file"
- lame -V6 -h audiodump.wav "$mp3"
- rm audiodump.wav
- else
- echo "File $file doesn't appear to exist."
- fi
- done
Add Comment
Please, Sign In to add comment