public abstract class FormatConversionProvider extends Object
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.
Modifier | Constructor | Description |
---|---|---|
protected |
Constructor for subclasses to call. |
Modifier and Type | Method | Description |
---|---|---|
abstract AudioInputStream |
getAudioInputStream |
Obtains an audio input stream with the specified encoding from the given audio input stream. |
abstract AudioInputStream |
getAudioInputStream |
Obtains an audio input stream with the specified format from the given audio input stream. |
abstract AudioFormat.Encoding[] |
getSourceEncodings() |
Obtains the set of source format encodings from which format conversion services are provided by this provider. |
abstract AudioFormat.Encoding[] |
getTargetEncodings() |
Obtains the set of target format encodings to which format conversion services are provided by this provider. |
abstract AudioFormat.Encoding[] |
getTargetEncodings |
Obtains the set of target format encodings supported by the format converter given a particular source format. |
abstract AudioFormat[] |
getTargetFormats |
Obtains the set of target formats with the encoding specified supported by the format converter. |
boolean |
isConversionSupported |
Indicates whether the format converter supports conversion to a particular encoding from a particular format. |
boolean |
isConversionSupported |
Indicates whether the format converter supports conversion to one particular format from another. |
boolean |
isSourceEncodingSupported |
Indicates whether the format converter supports conversion from the specified source format encoding. |
boolean |
isTargetEncodingSupported |
Indicates whether the format converter supports conversion to the specified target format encoding. |
protected FormatConversionProvider()
public abstract AudioFormat.Encoding[] getSourceEncodings()
public abstract AudioFormat.Encoding[] getTargetEncodings()
public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding)
sourceEncoding
- the source format encoding for which support is queriedtrue
if the encoding is supported, otherwise false
NullPointerException
- if sourceEncoding
is null
public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding)
targetEncoding
- the target format encoding for which support is queriedtrue
if the encoding is supported, otherwise false
NullPointerException
- if targetEncoding
is null
public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat)
sourceFormat
- format of the incoming dataNullPointerException
- if sourceFormat
is null
public boolean isConversionSupported(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat)
targetEncoding
- desired encoding of the outgoing datasourceFormat
- format of the incoming datatrue
if the conversion is supported, otherwise false
NullPointerException
- if targetEncoding
or sourceFormat
are null
public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat)
targetEncoding
- desired encoding of the stream after processingsourceFormat
- format of the incoming dataNullPointerException
- if targetEncoding
or sourceFormat
are null
public boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat)
targetFormat
- desired format of outgoing datasourceFormat
- format of the incoming datatrue
if the conversion is supported, otherwise false
NullPointerException
- if targetFormat
or sourceFormat
are null
public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream)
targetEncoding
- desired encoding of the stream after processingsourceStream
- stream from which data to be processed should be readIllegalArgumentException
- if the format combination supplied is not supportedNullPointerException
- if targetEncoding
or sourceStream
are null
public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream)
targetFormat
- desired data format of the stream after processingsourceStream
- stream from which data to be processed should be readIllegalArgumentException
- if the format combination supplied is not supportedNullPointerException
- if targetFormat
or sourceStream
are null
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/sound/sampled/spi/FormatConversionProvider.html