org.kc7bfi.jflac.sound.spi
Class FlacFormatConversionProvider

java.lang.Object
  extended by javax.sound.sampled.spi.FormatConversionProvider
      extended by org.kc7bfi.jflac.sound.spi.FlacFormatConversionProvider

public class FlacFormatConversionProvider
extends FormatConversionProvider

A format conversion provider provides format conversion services from one or more input formats to one or more output formats. Converters include codecs, which encode and/or decode audio data, as well as transcoders, etc. Format converters provide methods for determining what conversions are supported and for obtaining an audio stream from which converted data can be read. The source format represents the format of the incoming audio data, which will be converted. The target format represents the format of the processed, converted audio data. This is the format of the data that can be read from the stream returned by one of the getAudioInputStream methods.

Version:
$Revision: 1.1 $
Author:
Marc Gimpel, Wimba S.A. (marc@wimba.com), Florian Bomers

Constructor Summary
FlacFormatConversionProvider()
           
 
Method Summary
 AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream)
          Obtains an audio input stream with the specified encoding from the given audio input stream.
 AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream)
          Obtains an audio input stream with the specified format from the given audio input stream.
 AudioFormat.Encoding[] getSourceEncodings()
          Obtains the set of source format encodings from which format conversion services are provided by this provider.
 AudioFormat.Encoding[] getTargetEncodings()
          Obtains the set of target format encodings to which format conversion services are provided by this provider.
 AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat)
          Obtains the set of target format encodings supported by the format converter given a particular source format.
 AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat)
          Obtains the set of target formats with the encoding specified supported by the format converter.
 
Methods inherited from class javax.sound.sampled.spi.FormatConversionProvider
isConversionSupported, isConversionSupported, isSourceEncodingSupported, isTargetEncodingSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlacFormatConversionProvider

public FlacFormatConversionProvider()
Method Detail

getSourceEncodings

public AudioFormat.Encoding[] getSourceEncodings()
Obtains the set of source format encodings from which format conversion services are provided by this provider.

Specified by:
getSourceEncodings in class FormatConversionProvider
Returns:
array of source format encodings. The array will always have a length of at least 1.

getTargetEncodings

public AudioFormat.Encoding[] getTargetEncodings()
Obtains the set of target format encodings to which format conversion services are provided by this provider.

Specified by:
getTargetEncodings in class FormatConversionProvider
Returns:
array of target format encodings. The array will always have a length of at least 1.

getTargetEncodings

public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat)
Obtains the set of target format encodings supported by the format converter given a particular source format. If no target format encodings are supported for this source format, an array of length 0 is returned.

Specified by:
getTargetEncodings in class FormatConversionProvider
Parameters:
sourceFormat - format of the incoming data.
Returns:
array of supported target format encodings.

getTargetFormats

public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding,
                                      AudioFormat sourceFormat)
Obtains the set of target formats with the encoding specified supported by the format converter. If no target formats with the specified encoding are supported for this source format, an array of length 0 is returned.

Specified by:
getTargetFormats in class FormatConversionProvider
Parameters:
targetEncoding - desired encoding of the outgoing data.
sourceFormat - format of the incoming data.
Returns:
array of supported target formats.

getAudioInputStream

public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding,
                                            AudioInputStream sourceStream)
Obtains an audio input stream with the specified encoding from the given audio input stream.

Specified by:
getAudioInputStream in class FormatConversionProvider
Parameters:
targetEncoding - - desired encoding of the stream after processing.
sourceStream - - stream from which data to be processed should be read.
Returns:
stream from which processed data with the specified target encoding may be read.

getAudioInputStream

public AudioInputStream getAudioInputStream(AudioFormat targetFormat,
                                            AudioInputStream sourceStream)
Obtains an audio input stream with the specified format from the given audio input stream.

Specified by:
getAudioInputStream in class FormatConversionProvider
Parameters:
targetFormat - - desired data format of the stream after processing.
sourceStream - - stream from which data to be processed should be read.
Returns:
stream from which processed data with the specified format may be read.


Copyright © 2004-2011. All Rights Reserved.