List of usage examples for javax.sound.sampled AudioFileFormat toString
@Override
public String toString()
From source file:uk.co.modularaudio.service.audiofileioregistry.impl.AudioFileIORegistryServiceImpl.java
@Override public AudioFileFormat sniffFileFormatOfFile(final String path) throws DatastoreException, RecordNotFoundException, UnsupportedAudioFileException { AudioFileFormat retVal = AudioFileFormat.UNKNOWN; for (final AudioFileIOService oneService : services) { try {/* w w w. j a va 2 s .c o m*/ final AudioFileFormat foundFormat = oneService.sniffFileFormatOfFile(path); retVal = foundFormat; if (retVal != AudioFileFormat.UNKNOWN) { if (log.isTraceEnabled()) { log.trace("Service \"" + oneService.getClass().getSimpleName() + "\" recognised format as " + foundFormat.toString()); } return retVal; } } catch (final RecordNotFoundException rnfe) { if (log.isTraceEnabled()) { log.trace("Service \"" + oneService.getClass().getSimpleName() + "\" threw rnfe for file " + path); } } catch (final UnsupportedAudioFileException uafe) { if (log.isTraceEnabled()) { log.trace("Service \"" + oneService.getClass().getSimpleName() + "\" threw uafe for file " + path); } } } if (retVal == AudioFileFormat.UNKNOWN) { throw new UnsupportedAudioFileException("Could not determine type of file \"" + path + "\""); } return retVal; }