List providers = getAudioFileReaders();
AudioInputStream audioStream = null;
for(int i = 0; i < providers.size(); i++ ) {
AudioFileReader reader = (AudioFileReader) providers.get(i);
try {
audioStream = reader.getAudioInputStream( stream ); // throws IOException
break;
} catch (UnsupportedAudioFileException e) {
continue;
}
}