#!/bin/bash

if [ $# -eq 0 ]; then
  xmessage -buttons OK -default OK -timeout 10\
   "Drag and drop '*.flv' files on the icon to extract mp3"
fi
while [ -n "$1" ]; do
  target_file="$(echo $1 | sed -ne 's#.flv$#.mp3#p')"
  [ -n "$target_file" ] && [ -f "$1" ] &&\
   mplayer -dumpaudio "$1" -dumpfile "$target_file"
  shift
done
