org.xiph.speex.spi
Class SpeexAudioFileReader
AudioFileReader
org.xiph.speex.spi.SpeexAudioFileReader
public class SpeexAudioFileReader
extends AudioFileReader
Provider for Speex audio file reading services.
This implementation can parse the format information from Speex audio file,
and can produce audio input streams from files of this type.
- Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
static String | OGGID - The String that identifies the beginning of an Ogg packet.
|
static int | OGG_HEADERSIZE
|
static int | SEGOFFSET
|
static String | SPEEXID - The String that identifies the beginning of the Speex header.
|
static int | SPEEX_HEADERSIZE - The size of the Speex header.
|
AudioFileFormat | getAudioFileFormat(File file) - Obtains the audio file format of the File provided.
|
AudioFileFormat | getAudioFileFormat(InputStream stream) - Obtains an audio input stream from the input stream provided.
|
protected AudioFileFormat | getAudioFileFormat(InputStream bitStream, ByteArrayOutputStream baos, int mediaLength) - Return the AudioFileFormat from the given InputStream.
|
protected AudioFileFormat | getAudioFileFormat(InputStream stream, int medialength) - Return the AudioFileFormat from the given InputStream.
|
AudioFileFormat | getAudioFileFormat(URL url) - Obtains an audio input stream from the URL provided.
|
AudioInputStream | getAudioInputStream(File file) - Obtains an audio input stream from the File provided.
|
AudioInputStream | getAudioInputStream(InputStream stream) - Obtains an audio input stream from the input stream provided.
|
protected AudioInputStream | getAudioInputStream(InputStream inputStream, int medialength) - Obtains an audio input stream from the input stream provided.
|
AudioInputStream | getAudioInputStream(URL url) - Obtains an audio input stream from the URL provided.
|
private static int | readInt(byte[] data, int offset) - Converts Little Endian (Windows) bytes to an int (Java uses Big Endian).
|
OGGID
public static final String OGGID
The String that identifies the beginning of an Ogg packet.
OGG_HEADERSIZE
public static final int OGG_HEADERSIZE
SEGOFFSET
public static final int SEGOFFSET
SPEEXID
public static final String SPEEXID
The String that identifies the beginning of the Speex header.
SPEEX_HEADERSIZE
public static final int SPEEX_HEADERSIZE
The size of the Speex header.
getAudioFileFormat
public AudioFileFormat getAudioFileFormat(File file)
throws UnsupportedAudioFileException,
IOException
Obtains the audio file format of the File provided.
The File must point to valid audio file data.
file
- the File from which file format information should be
extracted.
- an AudioFileFormat object describing the audio file format.
getAudioFileFormat
public AudioFileFormat getAudioFileFormat(InputStream stream)
throws UnsupportedAudioFileException,
IOException
Obtains an audio input stream from the input stream provided.
stream
- the input stream from which the AudioInputStream should be
constructed.
- an AudioInputStream object based on the audio file data contained
in the input stream.
getAudioFileFormat
protected AudioFileFormat getAudioFileFormat(InputStream bitStream,
ByteArrayOutputStream baos,
int mediaLength)
throws UnsupportedAudioFileException,
IOException
Return the AudioFileFormat from the given InputStream. Implementation.
bitStream
- baos
- mediaLength
-
- an AudioInputStream object based on the audio file data contained
in the input stream.
getAudioFileFormat
protected AudioFileFormat getAudioFileFormat(InputStream stream,
int medialength)
throws UnsupportedAudioFileException,
IOException
Return the AudioFileFormat from the given InputStream.
stream
- the input stream from which the AudioInputStream should be
constructed.medialength
-
- an AudioInputStream object based on the audio file data contained
in the input stream.
getAudioFileFormat
public AudioFileFormat getAudioFileFormat(URL url)
throws UnsupportedAudioFileException,
IOException
Obtains an audio input stream from the URL provided.
The URL must point to valid audio file data.
url
- the URL for which the AudioInputStream should be constructed.
- an AudioInputStream object based on the audio file data pointed to
by the URL.
getAudioInputStream
public AudioInputStream getAudioInputStream(File file)
throws UnsupportedAudioFileException,
IOException
Obtains an audio input stream from the File provided.
The File must point to valid audio file data.
file
- the File for which the AudioInputStream should be constructed.
- an AudioInputStream object based on the audio file data pointed to
by the File.
getAudioInputStream
public AudioInputStream getAudioInputStream(InputStream stream)
throws UnsupportedAudioFileException,
IOException
Obtains an audio input stream from the input stream provided.
The stream must point to valid audio file data.
stream
- the input stream from which the AudioInputStream should be
constructed.
- an AudioInputStream object based on the audio file data contained
in the input stream.
getAudioInputStream
protected AudioInputStream getAudioInputStream(InputStream inputStream,
int medialength)
throws UnsupportedAudioFileException,
IOException
Obtains an audio input stream from the input stream provided.
The stream must point to valid audio file data.
inputStream
- the input stream from which the AudioInputStream should
be constructed.medialength
-
- an AudioInputStream object based on the audio file data contained
in the input stream.
getAudioInputStream
public AudioInputStream getAudioInputStream(URL url)
throws UnsupportedAudioFileException,
IOException
Obtains an audio input stream from the URL provided.
The URL must point to valid audio file data.
url
- the URL for which the AudioInputStream should be constructed.
- an AudioInputStream object based on the audio file data pointed to
by the URL.
readInt
private static int readInt(byte[] data,
int offset)
Converts Little Endian (Windows) bytes to an int (Java uses Big Endian).
data
- the data to read.offset
- the offset from which to start reading.
- the integer value of the reassembled bytes.
Copyright © 1999-2004 Wimba S.A. All Rights Reserved.