com.groovemanager.sampled.providers
Class AudioFileOutputStreamProvider

java.lang.Object
  extended by com.groovemanager.sampled.providers.AudioFileOutputStreamProvider
Direct Known Subclasses:
WavOutputStreamProvider

public abstract class AudioFileOutputStreamProvider
extends java.lang.Object

An AudioFileOutputStreamProvider is something similar to the AudioFileWriter SPI. An AudioFileWriter can provide AudioFileOutputStreams.

Author:
Manu Robledo

Constructor Summary
AudioFileOutputStreamProvider()
           
 
Method Summary
abstract  AudioFileOutputStream getAudioFileOutputStream(java.io.File f, javax.sound.sampled.AudioFileFormat.Type type, javax.sound.sampled.AudioFormat format, java.util.Map properties)
          Provide an AudioFileOutputStream
abstract  javax.sound.sampled.AudioFormat[] getSupportedFormats()
          Get the audio formats supported by this provider
abstract  java.lang.String[] getSupportedProperties()
          Get the property keys supported by this provider
abstract  javax.sound.sampled.AudioFileFormat.Type[] getSupportedTypes()
          Get the audio file types supported by this provider
 boolean isFormatSupported(javax.sound.sampled.AudioFormat format)
          Ask this provider, if the given AudioFormat is supported or not
 boolean isPropertySupported(java.lang.String property)
          Ask this provider, if it supports the property specified by the given kay.
 boolean isTypeSupported(javax.sound.sampled.AudioFileFormat.Type type)
          Ask this provider, if it supports the specified audio file type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioFileOutputStreamProvider

public AudioFileOutputStreamProvider()
Method Detail

getAudioFileOutputStream

public abstract AudioFileOutputStream getAudioFileOutputStream(java.io.File f,
                                                               javax.sound.sampled.AudioFileFormat.Type type,
                                                               javax.sound.sampled.AudioFormat format,
                                                               java.util.Map properties)
                                                        throws javax.sound.sampled.UnsupportedAudioFileException,
                                                               java.io.IOException
Provide an AudioFileOutputStream

Parameters:
f - The file to write to
type - The audio file type to write
format - The AudioFormat to write
properties - Map of properties to write into the file, if supported
Returns:
An AudioFileOutputStream matching the given parameters
Throws:
javax.sound.sampled.UnsupportedAudioFileException - If the audio file type is not supported
java.io.IOException - If an I/O Error occured during creation of the OutputStream

getSupportedFormats

public abstract javax.sound.sampled.AudioFormat[] getSupportedFormats()
Get the audio formats supported by this provider

Returns:
The audio formats supported by this provider

getSupportedProperties

public abstract java.lang.String[] getSupportedProperties()
Get the property keys supported by this provider

Returns:
The property keys supported by this provider

getSupportedTypes

public abstract javax.sound.sampled.AudioFileFormat.Type[] getSupportedTypes()
Get the audio file types supported by this provider

Returns:
The audio file types supported by this provider

isFormatSupported

public boolean isFormatSupported(javax.sound.sampled.AudioFormat format)
Ask this provider, if the given AudioFormat is supported or not

Parameters:
format - The AudioFormat to ask for
Returns:
true, if the given format is supported, false otherwise.

isPropertySupported

public boolean isPropertySupported(java.lang.String property)
Ask this provider, if it supports the property specified by the given kay.

Parameters:
property - The property key to ask for
Returns:
true, if this property key is understood, false otherwise.

isTypeSupported

public boolean isTypeSupported(javax.sound.sampled.AudioFileFormat.Type type)
Ask this provider, if it supports the specified audio file type

Parameters:
type - The AudioTypeFormat.Type to ask for
Returns:
true, if the given type is supported, false otherwise