You could break it up into two loops.
Code:
for rfile in *.txt; do
echo $rfile is a text file
# do stuff
done
for rfile in *.mp3; do
echo $rfile is an mp3 file
#do stuff
done
Another thing you could do is use the find command.
find . -type f -iname "*.txt" -exec <command> \;
find . -type f -iname "*.mp3" -exec <command> \;
Be sure to read through the bash info manual. In particular the section on "test" & "[[" and the section on variable expansion.
also enter "help test" in the shell.