public class AuFileReader
extends javax.sound.sampled.spi.AudioFileReader
Modifier and Type | Field and Description |
---|---|
protected static int |
bisBufferSize |
static javax.sound.sampled.AudioFileFormat.Type[] |
types
AU reader type
|
Constructor and Description |
---|
AuFileReader()
Constructs a new AuFileReader object.
|
Modifier and Type | Method and Description |
---|---|
protected int |
big2little(int i)
big2little
Protected helper method to swap the order of bytes in a 32 bit int
|
protected short |
big2littleShort(short i)
big2little
Protected helper method to swap the order of bytes in a 16 bit short
|
protected static int |
calculatePCMFrameSize(int sampleSizeInBits,
int channels)
Calculates the frame size for PCM frames.
|
javax.sound.sampled.AudioFileFormat |
getAudioFileFormat(java.io.File file)
Obtains the audio file format of the File provided.
|
javax.sound.sampled.AudioFileFormat |
getAudioFileFormat(java.io.InputStream stream)
Obtains the audio file format of the input stream provided.
|
javax.sound.sampled.AudioFileFormat |
getAudioFileFormat(java.net.URL url)
Obtains the audio file format of the URL provided.
|
javax.sound.sampled.AudioInputStream |
getAudioInputStream(java.io.File file)
Obtains an audio stream from the File provided.
|
javax.sound.sampled.AudioInputStream |
getAudioInputStream(java.io.InputStream stream)
Obtains an audio stream from the input stream provided.
|
javax.sound.sampled.AudioInputStream |
getAudioInputStream(java.net.URL url)
Obtains an audio stream from the URL provided.
|
protected int |
rllong(java.io.DataInputStream dis)
rllong
Protected helper method to read 64 bits and changing the order of
each bytes.
|
protected short |
rlshort(java.io.DataInputStream dis)
rlshort
Protected helper method to read 16 bits value.
|
public static final javax.sound.sampled.AudioFileFormat.Type[] types
protected static final int bisBufferSize
public javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.InputStream stream) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
stream
- the input stream from which file format information should be
extractedAudioFileFormat
object describing the audio file formatjavax.sound.sampled.UnsupportedAudioFileException
- if the stream does not point to valid audio
file data recognized by the systemjava.io.IOException
- if an I/O exception occursInputStream.markSupported()
,
InputStream.mark(int)
public javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.net.URL url) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
url
- the URL from which file format information should be
extractedAudioFileFormat
object describing the audio file formatjavax.sound.sampled.UnsupportedAudioFileException
- if the URL does not point to valid audio
file data recognized by the systemjava.io.IOException
- if an I/O exception occurspublic javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.File file) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
file
- the File from which file format information should be
extractedAudioFileFormat
object describing the audio file formatjavax.sound.sampled.UnsupportedAudioFileException
- if the File does not point to valid audio
file data recognized by the systemjava.io.IOException
- if an I/O exception occurspublic javax.sound.sampled.AudioInputStream getAudioInputStream(java.io.InputStream stream) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
stream
- the input stream from which the AudioInputStream
should be
constructedAudioInputStream
object based on the audio file data contained
in the input stream.javax.sound.sampled.UnsupportedAudioFileException
- if the stream does not point to valid audio
file data recognized by the systemjava.io.IOException
- if an I/O exception occursInputStream.markSupported()
,
InputStream.mark(int)
public javax.sound.sampled.AudioInputStream getAudioInputStream(java.net.URL url) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
url
- the URL for which the AudioInputStream
should be
constructedAudioInputStream
object based on the audio file data pointed
to by the URLjavax.sound.sampled.UnsupportedAudioFileException
- if the URL does not point to valid audio
file data recognized by the systemjava.io.IOException
- if an I/O exception occurspublic javax.sound.sampled.AudioInputStream getAudioInputStream(java.io.File file) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
file
- the File for which the AudioInputStream
should be
constructedAudioInputStream
object based on the audio file data pointed
to by the Filejavax.sound.sampled.UnsupportedAudioFileException
- if the File does not point to valid audio
file data recognized by the systemjava.io.IOException
- if an I/O exception occursprotected int rllong(java.io.DataInputStream dis) throws java.io.IOException
DataInputStream
- java.io.IOException
protected int big2little(int i)
int
- protected short rlshort(java.io.DataInputStream dis) throws java.io.IOException
DataInputStream
- java.io.IOException
protected short big2littleShort(short i)
int
- protected static int calculatePCMFrameSize(int sampleSizeInBits, int channels)
sampleSizeInBits
- the size of a single sample in bitschannels
- the number of channels