Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function apetoflac(){
- if which ffmpeg &>/dev/null; then
- COUNTER=$(find . -maxdepth $1 -iname "*.ape" | sed -n '$=')
- until [ $COUNTER -lt 0 ]; do
- export IFS=""
- APEFILE=$(find . -maxdepth $1 -iname "*.ape" | head -n 1 | sed "s/^[./]*//")
- if [ "$APEFILE" ]; then
- FLACFILE=$(echo "$APEFILE" | sed -e "s/.ape/.flac/" )
- echo "-------------------strating conversion----------------------------"
- echo $APEFILE
- echo $FLACFILE
- ffmpeg -i $APEFILE $FLACFILE &>/dev/null
- echo "Converting complete"
- rm -f $APEFILE
- export IFS=" "
- let COUNTER-=1
- echo "Only " "$COUNTER" " files left"
- notify-send "Files to be done: " "$COUNTER"
- else
- echo "no .ape found"
- let COUNTER-=1
- export IFS=" "
- fi
- done
- else
- echo "ffmeg is not on your system. aborting."
- notify-send "ffmeg is not on your system. aborting."
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement