public class

AudioFloatFormatConverter

extends FormatConversionProvider
java.lang.Object
   ↳ javax.sound.sampled.spi.FormatConversionProvider
     ↳ com.sun.media.sound.AudioFloatFormatConverter

Class Overview

This class is used to convert between 8,16,24,32 bit signed/unsigned big/litle endian fixed/floating stereo/mono/multi-channel audio streams and perform sample-rate conversion if needed.

Summary

Public Constructors
AudioFloatFormatConverter()
Public Methods
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, AudioFloatInputStream sourceStream)
AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream)
Obtains an audio input stream with the specified format from the given audio input stream.
Encoding[] getSourceEncodings()
Obtains the set of source format encodings from which format conversion services are provided by this provider.
Encoding[] getTargetEncodings(AudioFormat sourceFormat)
Obtains the set of target format encodings supported by the format converter given a particular source format.
Encoding[] getTargetEncodings()
Obtains the set of target format encodings to which format conversion services are provided by this provider.
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.
boolean isConversionSupported(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat)
Indicates whether the format converter supports conversion to a particular encoding from a particular format.
boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat)
Indicates whether the format converter supports conversion to one particular format from another.
[Expand]
Inherited Methods
From class javax.sound.sampled.spi.FormatConversionProvider
From class java.lang.Object

Public Constructors

public AudioFloatFormatConverter ()

Public Methods

public AudioInputStream getAudioInputStream (AudioFormat.Encoding targetEncoding, 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

public AudioInputStream getAudioInputStream (AudioFormat targetFormat, AudioFloatInputStream sourceStream)

public AudioInputStream getAudioInputStream (AudioFormat targetFormat, 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

public 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.

public 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.

Returns
  • array of supported target format encodings.

public 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.

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.

Returns
  • array of supported target formats.

public boolean isConversionSupported (AudioFormat.Encoding targetEncoding, 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

public boolean isConversionSupported (AudioFormat targetFormat, 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