APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.media.sound

public final Class WaveFileWriter

extends SunFileWriter
Class Inheritance
Imports
java.io.BufferedOutputStream, .ByteArrayInputStream, .ByteArrayOutputStream, .DataOutputStream, .File, .FileOutputStream, .IOException, .InputStream, .OutputStream, .RandomAccessFile, .SequenceInputStream, java.util.Objects, javax.sound.sampled.AudioFileFormat, .AudioFormat, .AudioInputStream, .AudioSystem

WAVE file writer.
Author
Jan Borgersen

Field Summary

Inherited from com.sun.media.sound.SunFileWriter:
bisBufferSizebufferSizetypes

Constructor Summary

AccessConstructor and Description
public
WaveFileWriter()

Constructs a new WaveFileWriter object.

Method Summary

Modifier and TypeMethod and Description
private AudioFileFormat
getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream)

Returns the AudioFileFormat describing the file that will be written from this AudioInputStream.

public AudioFileFormat.Type[]
getAudioFileTypes(AudioInputStream stream)

Implements abstract javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes.

Obtains the file types that this audio file writer can write from the audio input stream specified.

private InputStream
getFileStream(WaveFileFormat waveFileFormat, InputStream audioStream)

public int
write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out)

Implements abstract javax.sound.sampled.spi.AudioFileWriter.write.

Writes a stream of bytes representing an audio file of the file type indicated to the output stream provided.

public int
write(AudioInputStream stream, AudioFileFormat.Type fileType, File out)

Implements abstract javax.sound.sampled.spi.AudioFileWriter.write.

Writes a stream of bytes representing an audio file of the file format indicated to the external file provided.

private int
Inherited from com.sun.media.sound.SunFileWriter:
big2littlebig2littleShortgetAudioFileTypesrllongrlshort

Constructor Detail

WaveFileWriterback to summary
public WaveFileWriter()

Constructs a new WaveFileWriter object.

Method Detail

getAudioFileFormatback to summary
private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream)

Returns the AudioFileFormat describing the file that will be written from this AudioInputStream. Throws IllegalArgumentException if not supported.

getAudioFileTypesback to summary
public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream)

Implements abstract javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes.

Doc from javax.sound.sampled.spi.AudioFileWriter.getAudioFileTypes.

Obtains the file types that this audio file writer can write from the audio input stream specified.

Annotations
@Override
getFileStreamback to summary
private InputStream getFileStream(WaveFileFormat waveFileFormat, InputStream audioStream) throws IOException
writeback to summary
public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException

Implements abstract javax.sound.sampled.spi.AudioFileWriter.write.

Doc from javax.sound.sampled.spi.AudioFileWriter.write.

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.

Annotations
@Override
Exceptions
IOException:
if an I/O exception occurs
writeback to summary
public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException

Implements abstract javax.sound.sampled.spi.AudioFileWriter.write.

Doc from javax.sound.sampled.spi.AudioFileWriter.write.

Writes a stream of bytes representing an audio file of the file format indicated to the external file provided.

Annotations
@Override
Exceptions
IOException:
if an I/O exception occurs
writeWaveFileback to summary
private int writeWaveFile(InputStream in, WaveFileFormat waveFileFormat, OutputStream out) throws IOException