Provider for audio file writing services. Classes providing concrete
implementations can write one or more types of audio file from an audio
stream.
Method from javax.sound.sampled.spi.AudioFileWriter Detail: |
abstract public Type[] getAudioFileTypes()
Obtains the file types for which file writing support is provided by this
audio file writer. |
abstract public Type[] getAudioFileTypes(AudioInputStream stream)
Obtains the file types that this audio file writer can write from the
audio input stream specified. |
public boolean isFileTypeSupported(Type fileType) {
AudioFileFormat.Type types[] = getAudioFileTypes();
for(int i=0; i< types.length; i++) {
if( fileType.equals( types[i] ) ) {
return true;
}
}
return false;
}
Indicates whether file writing support for the specified file type is provided
by this audio file writer. |
public boolean isFileTypeSupported(Type fileType,
AudioInputStream stream) {
AudioFileFormat.Type types[] = getAudioFileTypes( stream );
for(int i=0; i< types.length; i++) {
if( fileType.equals( types[i] ) ) {
return true;
}
}
return false;
}
Indicates whether an audio file of the type specified can be written
from the audio input stream indicated. |
abstract public int write(AudioInputStream stream,
Type fileType,
OutputStream out) throws IOException
Writes a stream of bytes representing an audio file of the file type
indicated to the output stream provided. Some file types require that
the length be written into the file header, and cannot be written from
start to finish unless the length is known in advance. An attempt
to write such a file type will fail with an IOException if the length in
the audio file format is
AudioSystem.NOT_SPECIFIED . |
abstract public int write(AudioInputStream stream,
Type fileType,
File out) throws IOException
Writes a stream of bytes representing an audio file of the file format
indicated to the external file provided. |