Package org.xiph.speex.spi
Class SpeexAudioFileWriter
java.lang.Object
javax.sound.sampled.spi.AudioFileWriter
org.xiph.speex.spi.SpeexAudioFileWriter
Provider for Speex audio file writing services.
This implementation can write Speex audio files from an audio stream.
- Version:
- $Revision: 1.3 $
- Author:
- Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AudioFileFormat.Type[]
static final AudioFileFormat.Type[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtains the file types for which file writing support is provided by this audio file writer.getAudioFileTypes
(AudioInputStream stream) Obtains the file types that this audio file writer can write from the audio input stream specified.private int
write
(AudioInputStream stream, OutputStream out) Writes a stream of bytes representing an audio file of the file type indicated to the output stream provided.int
write
(AudioInputStream stream, AudioFileFormat.Type fileType, File out) Writes a stream of bytes representing an audio file of the file format indicated to the external file provided.int
write
(AudioInputStream stream, AudioFileFormat.Type fileType, 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 javax.sound.sampled.spi.AudioFileWriter
isFileTypeSupported, isFileTypeSupported
-
Field Details
-
NO_FORMAT
-
SPEEX_FORMAT
-
-
Constructor Details
-
SpeexAudioFileWriter
public SpeexAudioFileWriter()
-
-
Method Details
-
getAudioFileTypes
Obtains the file types for which file writing support is provided by this audio file writer.- Specified by:
getAudioFileTypes
in classAudioFileWriter
- Returns:
- array of file types. If no file types are supported, an array of length 0 is returned.
-
getAudioFileTypes
Obtains the file types that this audio file writer can write from the audio input stream specified.- Specified by:
getAudioFileTypes
in classAudioFileWriter
- 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.
-
write
public int write(AudioInputStream stream, AudioFileFormat.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.- Specified by:
write
in classAudioFileWriter
- 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
- - if an I/O exception occurs.IllegalArgumentException
- - if the file type is not supported by the system.- See Also:
-
write
public int write(AudioInputStream stream, AudioFileFormat.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.- Specified by:
write
in classAudioFileWriter
- 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
- - if an I/O exception occurs.IllegalArgumentException
- - if the file format is not supported by the system- See Also:
-
write
Writes a stream of bytes representing an audio file of the file type indicated to the output stream provided.- Parameters:
stream
- - the audio input stream containing audio data 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
- - if an I/O exception occurs.
-