if (!stream.markSupported()) {
stream = new BufferedInputStream(stream);
}
try {
AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(stream);
Type type = fileFormat.getType();
if (type == Type.AIFC || type == Type.AIFF) {
metadata.set(Metadata.CONTENT_TYPE, "audio/x-aiff");
} else if (type == Type.AU || type == Type.SND) {
metadata.set(Metadata.CONTENT_TYPE, "audio/basic");
} else if (type == Type.WAVE) {