com.groovemanager.sampled.providers
Class WavFormatProvider

java.lang.Object
  extended by com.groovemanager.sampled.providers.AudioFileFormatProvider
      extended by com.groovemanager.sampled.providers.WavFormatProvider

public class WavFormatProvider
extends AudioFileFormatProvider

This implementation of AudioFileFormatProvider reads the AudioFileFormat out of a wave file. It supports "RLND" and "slices" properties

Author:
Manu Robledo

Field Summary
private static javax.sound.sampled.AudioFormat[] FORMATS
          Supported formats
private static java.lang.String[] PROPERTIES
          Supported properties
private static WavFileReader reader
          WavFileReader used to delegate the calls
private static javax.sound.sampled.AudioFileFormat.Type[] TYPES
          Supported types
 
Constructor Summary
WavFormatProvider()
           
 
Method Summary
protected static javax.sound.sampled.AudioFormat[] createFormats()
          Create the supported AudioFormats
 javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.File f)
          Get the AudioFileFormat out of the given file
 javax.sound.sampled.AudioFormat[] getSupportedFormats()
          Get the AudioFormats supported by this provider
 java.lang.String[] getSupportedProperties()
          Get the property keys understood by this provider
 javax.sound.sampled.AudioFileFormat.Type[] getSupportedTypes()
          Get the AudioFileFormat.Types supported by this provider
 boolean isFileSupported(java.io.File f)
          Ask this provider, if it is able to get the AudioFileFormat out of this file
 boolean isFormatSupported(javax.sound.sampled.AudioFormat format)
          Ask this provider, if the given AudioFormat is supported or not
 
Methods inherited from class com.groovemanager.sampled.providers.AudioFileFormatProvider
isPropertySupported, isTypeSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMATS

private static final javax.sound.sampled.AudioFormat[] FORMATS
Supported formats


PROPERTIES

private static final java.lang.String[] PROPERTIES
Supported properties


reader

private static final WavFileReader reader
WavFileReader used to delegate the calls


TYPES

private static final javax.sound.sampled.AudioFileFormat.Type[] TYPES
Supported types

Constructor Detail

WavFormatProvider

public WavFormatProvider()
Method Detail

createFormats

protected static javax.sound.sampled.AudioFormat[] createFormats()
Create the supported AudioFormats

Returns:
Array of supported AudioFormats

getAudioFileFormat

public javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.File f)
                                                       throws javax.sound.sampled.UnsupportedAudioFileException,
                                                              java.io.IOException
Description copied from class: AudioFileFormatProvider
Get the AudioFileFormat out of the given file

Specified by:
getAudioFileFormat in class AudioFileFormatProvider
Parameters:
f - The file to be read
Returns:
The AudioFileFormat of the specified file.
Throws:
javax.sound.sampled.UnsupportedAudioFileException - If the format of the file is not known or invalid
java.io.IOException - If an I/O Error occured during reading
See Also:
AudioFileFormatProvider.getAudioFileFormat(java.io.File)

getSupportedFormats

public javax.sound.sampled.AudioFormat[] getSupportedFormats()
Description copied from class: AudioFileFormatProvider
Get the AudioFormats supported by this provider

Specified by:
getSupportedFormats in class AudioFileFormatProvider
Returns:
The audio formats supported by this provider
See Also:
AudioFileFormatProvider.getSupportedFormats()

getSupportedProperties

public java.lang.String[] getSupportedProperties()
Description copied from class: AudioFileFormatProvider
Get the property keys understood by this provider

Specified by:
getSupportedProperties in class AudioFileFormatProvider
Returns:
The property keys of the properties this provider can provide
See Also:
AudioFileFormatProvider.getSupportedProperties()

getSupportedTypes

public javax.sound.sampled.AudioFileFormat.Type[] getSupportedTypes()
Description copied from class: AudioFileFormatProvider
Get the AudioFileFormat.Types supported by this provider

Specified by:
getSupportedTypes in class AudioFileFormatProvider
Returns:
The audio file types supported by this provider
See Also:
AudioFileFormatProvider.getSupportedTypes()

isFileSupported

public boolean isFileSupported(java.io.File f)
Description copied from class: AudioFileFormatProvider
Ask this provider, if it is able to get the AudioFileFormat out of this file

Specified by:
isFileSupported in class AudioFileFormatProvider
Parameters:
f - The file to ask for
Returns:
true, if this file is supported, false otherwise
See Also:
AudioFileFormatProvider.isFileSupported(java.io.File)

isFormatSupported

public boolean isFormatSupported(javax.sound.sampled.AudioFormat format)
Description copied from class: AudioFileFormatProvider
Ask this provider, if the given AudioFormat is supported or not

Overrides:
isFormatSupported in class AudioFileFormatProvider
Parameters:
format - The AudioFormat to ask for
Returns:
true, if the given format is supported, false otherwise.
See Also:
AudioFileFormatProvider.isFormatSupported(javax.sound.sampled.AudioFormat)