javax.sound.sampled.spi
Class AudioFileWriter

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

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

Provider for audio file writing services. Classes providing concrete implementations can write one or more types of audio file from an audio stream.

Since:
1.3

Constructor Summary
AudioFileWriter sample code for javax.sound.sampled.spi.AudioFileWriter.AudioFileWriter() definition code for javax.sound.sampled.spi.AudioFileWriter.AudioFileWriter() ()
           
 
Method Summary
abstract  AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type [] getAudioFileTypes sample code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes() definition code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes() ()
          Obtains the file types for which file writing support is provided by this audio file writer.
abstract  AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type [] getAudioFileTypes sample code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes(javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes(javax.sound.sampled.AudioInputStream) (AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream)
          Obtains the file types that this audio file writer can write from the audio input stream specified.
 boolean isFileTypeSupported sample code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type) definition code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type) (AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType)
          Indicates whether file writing support for the specified file type is provided by this audio file writer.
 boolean isFileTypeSupported sample code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type, javax.sound.sampled.AudioInputStream) (AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType, AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream)
          Indicates whether an audio file of the type specified can be written from the audio input stream indicated.
abstract  int write sample code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.File) definition code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.File) (AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream, AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType, File sample code for java.io.File definition code for java.io.File  out)
          Writes a stream of bytes representing an audio file of the file format indicated to the external file provided.
abstract  int write sample code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.OutputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.OutputStream) (AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream, AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType, OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  out)
          Writes a stream of bytes representing an audio file of the file type indicated to the output stream provided.
 
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

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

public AudioFileWriter()
Method Detail

getAudioFileTypes sample code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes() definition code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes()

public abstract AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type [] getAudioFileTypes()
Obtains the file types for which file writing support is provided by this audio file writer.

Returns:
array of file types. If no file types are supported, an array of length 0 is returned.

isFileTypeSupported sample code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type) definition code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type)

public boolean isFileTypeSupported(AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType)
Indicates whether file writing support for the specified file type is provided by this audio file writer.

Parameters:
fileType - the file type for which write capabilities are queried
Returns:
true if the file type is supported, otherwise false

getAudioFileTypes sample code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes(javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes(javax.sound.sampled.AudioInputStream)

public abstract AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type [] getAudioFileTypes(AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream)
Obtains the file types that this audio file writer can write from the audio input stream specified.

Parameters:
stream - the audio input stream for which audio file type support is queried
Returns:
array of file types. If no file types are supported, an array of length 0 is returned.

isFileTypeSupported sample code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type, javax.sound.sampled.AudioInputStream)

public boolean isFileTypeSupported(AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType,
                                   AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream)
Indicates whether an audio file of the type specified can be written from the audio input stream indicated.

Parameters:
fileType - file type for which write capabilities are queried
stream - for which file writing support is queried
Returns:
true if the file type is supported for this audio input stream, otherwise false

write sample code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.OutputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.OutputStream)

public abstract int write(AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream,
                          AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType,
                          OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  out)
                   throws IOException sample code for java.io.IOException definition code for java.io.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 sample code for javax.sound.sampled.AudioSystem.NOT_SPECIFIED definition code for javax.sound.sampled.AudioSystem.NOT_SPECIFIED .

Parameters:
stream - the audio input stream containing audio data to be written to the output stream
fileType - file type to be written to the output stream
out - stream to which the file data should be written
Returns:
the number of bytes written to the output stream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O exception occurs
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the file type is not supported by the system
See Also:
isFileTypeSupported(AudioFileFormat.Type, AudioInputStream) sample code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type, javax.sound.sampled.AudioInputStream) definition code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type, javax.sound.sampled.AudioInputStream) , getAudioFileTypes() sample code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes() definition code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes()

write sample code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.File) definition code for javax.sound.sampled.spi.AudioFileWriter.write(javax.sound.sampled.AudioInputStream, javax.sound.sampled.AudioFileFormat.Type, java.io.File)

public abstract int write(AudioInputStream sample code for javax.sound.sampled.AudioInputStream definition code for javax.sound.sampled.AudioInputStream  stream,
                          AudioFileFormat.Type sample code for javax.sound.sampled.AudioFileFormat.Type definition code for javax.sound.sampled.AudioFileFormat.Type  fileType,
                          File sample code for java.io.File definition code for java.io.File  out)
                   throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes a stream of bytes representing an audio file of the file format indicated to the external file provided.

Parameters:
stream - the audio input stream containing audio data to be written to the file
fileType - file type to be written to the file
out - external file to which the file data should be written
Returns:
the number of bytes written to the file
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O exception occurs
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the file format is not supported by the system
See Also:
isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type) sample code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type) definition code for javax.sound.sampled.spi.AudioFileWriter.isFileTypeSupported(javax.sound.sampled.AudioFileFormat.Type) , getAudioFileTypes() sample code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes() definition code for javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes()