javax.sound.sampled.spi
Class FormatConversionProvider

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.sound.sampled.spi.FormatConversionProvider

public abstract class FormatConversionProvider
extends Object sample code for java.lang.Object definition code for java.lang.Object

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.

Since:
1.3

Constructor Summary
FormatConversionProvider sample code for javax.sound.sampled.spi.FormatConversionProvider.FormatConversionProvider() definition code for javax.sound.sampled.spi.FormatConversionProvider.FormatConversionProvider() ()
           
 
Method Summary
abstract  AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream getAudioInputStream sample code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioInputStream) (AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding, AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  sourceStream)
          Obtains an audio input stream with the specified encoding from the given audio input stream.
abstract  AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream getAudioInputStream sample code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioInputStream) (AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  targetFormat, AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  sourceStream)
          Obtains an audio input stream with the specified format from the given audio input stream.
abstract  AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding [] getSourceEncodings sample code for javax.sound.sampled.spi.FormatConversionProvider.getSourceEncodings() definition code for javax.sound.sampled.spi.FormatConversionProvider.getSourceEncodings() ()
          Obtains the set of source format encodings from which format conversion services are provided by this provider.
abstract  AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding [] getTargetEncodings sample code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings() definition code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings() ()
          Obtains the set of target format encodings to which format conversion services are provided by this provider.
abstract  AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding [] getTargetEncodings sample code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings(javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings(javax.sound.sampled.AudioFormat) (AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  sourceFormat)
          Obtains the set of target format encodings supported by the format converter given a particular source format.
abstract  AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat [] getTargetFormats sample code for javax.sound.sampled.spi.FormatConversionProvider.getTargetFormats(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.getTargetFormats(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat) (AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding, AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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.
 boolean isConversionSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat) (AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding, AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  sourceFormat)
          Indicates whether the format converter supports conversion to a particular encoding from a particular format.
 boolean isConversionSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioFormat) (AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  targetFormat, AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  sourceFormat)
          Indicates whether the format converter supports conversion to one particular format from another.
 boolean isSourceEncodingSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isSourceEncodingSupported(javax.sound.sampled.AudioFormat.Encoding) definition code for javax.sound.sampled.spi.FormatConversionProvider.isSourceEncodingSupported(javax.sound.sampled.AudioFormat.Encoding) (AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  sourceEncoding)
          Indicates whether the format converter supports conversion from the specified source format encoding.
 boolean isTargetEncodingSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isTargetEncodingSupported(javax.sound.sampled.AudioFormat.Encoding) definition code for javax.sound.sampled.spi.FormatConversionProvider.isTargetEncodingSupported(javax.sound.sampled.AudioFormat.Encoding) (AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding)
          Indicates whether the format converter supports conversion to the specified target format encoding.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

FormatConversionProvider sample code for javax.sound.sampled.spi.FormatConversionProvider() definition code for javax.sound.sampled.spi.FormatConversionProvider()

public FormatConversionProvider()
Method Detail

getSourceEncodings sample code for javax.sound.sampled.spi.FormatConversionProvider.getSourceEncodings() definition code for javax.sound.sampled.spi.FormatConversionProvider.getSourceEncodings()

public abstract AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding [] getSourceEncodings()
Obtains the set of source format encodings from which format conversion services are provided by this provider.

Returns:
array of source format encodings. The array will always have a length of at least 1.

getTargetEncodings sample code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings() definition code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings()

public abstract AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding [] getTargetEncodings()
Obtains the set of target format encodings to which format conversion services are provided by this provider.

Returns:
array of target format encodings. The array will always have a length of at least 1.

isSourceEncodingSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isSourceEncodingSupported(javax.sound.sampled.AudioFormat.Encoding) definition code for javax.sound.sampled.spi.FormatConversionProvider.isSourceEncodingSupported(javax.sound.sampled.AudioFormat.Encoding)

public boolean isSourceEncodingSupported(AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  sourceEncoding)
Indicates whether the format converter supports conversion from the specified source format encoding.

Parameters:
sourceEncoding - the source format encoding for which support is queried
Returns:
true if the encoding is supported, otherwise false

isTargetEncodingSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isTargetEncodingSupported(javax.sound.sampled.AudioFormat.Encoding) definition code for javax.sound.sampled.spi.FormatConversionProvider.isTargetEncodingSupported(javax.sound.sampled.AudioFormat.Encoding)

public boolean isTargetEncodingSupported(AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding)
Indicates whether the format converter supports conversion to the specified target format encoding.

Parameters:
targetEncoding - the target format encoding for which support is queried
Returns:
true if the encoding is supported, otherwise false

getTargetEncodings sample code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings(javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.getTargetEncodings(javax.sound.sampled.AudioFormat)

public abstract AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding [] getTargetEncodings(AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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.

Returns:
array of supported target format encodings.

isConversionSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat)

public boolean isConversionSupported(AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding,
                                     AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  sourceFormat)
Indicates whether the format converter supports conversion to a particular encoding from a particular format.

Parameters:
targetEncoding - desired encoding of the outgoing data
sourceFormat - format of the incoming data
Returns:
true if the conversion is supported, otherwise false

getTargetFormats sample code for javax.sound.sampled.spi.FormatConversionProvider.getTargetFormats(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.getTargetFormats(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioFormat)

public abstract AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat [] getTargetFormats(AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding,
                                               AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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.

Returns:
array of supported target formats.

isConversionSupported sample code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.spi.FormatConversionProvider.isConversionSupported(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioFormat)

public boolean isConversionSupported(AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  targetFormat,
                                     AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  sourceFormat)
Indicates whether the format converter supports conversion to one particular format from another.

Parameters:
targetFormat - desired format of outgoing data
sourceFormat - format of the incoming data
Returns:
true if the conversion is supported, otherwise false

getAudioInputStream sample code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat.Encoding, javax.sound.sampled.AudioInputStream)

public abstract AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  getAudioInputStream(AudioFormat.Encoding sample code for javax.sound.sampled.AudioFormat.Encoding definition code for javax.sound.sampled.AudioFormat.Encoding  targetEncoding,
                                                     AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  sourceStream)
Obtains an audio input stream with the specified encoding from the given audio input stream.

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
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the format combination supplied is not supported.

getAudioInputStream sample code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.FormatConversionProvider.getAudioInputStream(javax.sound.sampled.AudioFormat, javax.sound.sampled.AudioInputStream)

public abstract AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  getAudioInputStream(AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  targetFormat,
                                                     AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  sourceStream)
Obtains an audio input stream with the specified format from the given audio input stream.

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
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the format combination supplied is not supported.