org.tritonus.share.sampled.file
Class TAudioFileReader

java.lang.Object
  extended by javax.sound.sampled.spi.AudioFileReader
      extended by org.tritonus.share.sampled.file.TAudioFileReader
Direct Known Subclasses:
AiffAudioFileReader, AuAudioFileReader, GSMAudioFileReader, JorbisAudioFileReader, VorbisAudioFileReader, VorbisAudioFileReader, WaveAudioFileReader

public abstract class TAudioFileReader
extends AudioFileReader

Base class for audio file readers. This is Tritonus' base class for classes that provide the facility of detecting an audio file type and reading its header. Classes should be derived from this class or one of its subclasses rather than from javax.sound.sampled.spi.AudioFileReader.


Method Summary
 AudioFileFormat getAudioFileFormat(java.io.File file)
          Get an AudioFileFormat object for a File.
 AudioFileFormat getAudioFileFormat(java.io.InputStream inputStream)
          Get an AudioFileFormat object for an InputStream.
 AudioFileFormat getAudioFileFormat(java.net.URL url)
          Get an AudioFileFormat object for a URL.
 AudioInputStream getAudioInputStream(java.io.File file)
          Get an AudioInputStream object for a file.
 AudioInputStream getAudioInputStream(java.io.InputStream inputStream)
          Get an AudioInputStream object for an InputStream.
 AudioInputStream getAudioInputStream(java.net.URL url)
          Get an AudioInputStream object for a URL.
static double readIeeeExtended(java.io.DataInputStream dis)
           
static int readLittleEndianInt(java.io.InputStream is)
           
static short readLittleEndianShort(java.io.InputStream is)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAudioFileFormat

public AudioFileFormat getAudioFileFormat(java.io.File file)
                                   throws UnsupportedAudioFileException,
                                          java.io.IOException
Get an AudioFileFormat object for a File. This method calls getAudioFileFormat(InputStream, long). Subclasses should not override this method unless there are really severe reasons. Normally, it is sufficient to implement getAudioFileFormat(InputStream, long).

Specified by:
getAudioFileFormat in class AudioFileReader
Parameters:
file - the file to read from.
Returns:
an AudioFileFormat instance containing information from the header of the file passed in.
Throws:
UnsupportedAudioFileException
java.io.IOException

getAudioFileFormat

public AudioFileFormat getAudioFileFormat(java.net.URL url)
                                   throws UnsupportedAudioFileException,
                                          java.io.IOException
Get an AudioFileFormat object for a URL. This method calls getAudioFileFormat(InputStream, long). Subclasses should not override this method unless there are really severe reasons. Normally, it is sufficient to implement getAudioFileFormat(InputStream, long).

Specified by:
getAudioFileFormat in class AudioFileReader
Parameters:
url - the URL to read from.
Returns:
an AudioFileFormat instance containing information from the header of the URL passed in.
Throws:
UnsupportedAudioFileException
java.io.IOException

getAudioFileFormat

public AudioFileFormat getAudioFileFormat(java.io.InputStream inputStream)
                                   throws UnsupportedAudioFileException,
                                          java.io.IOException
Get an AudioFileFormat object for an InputStream. This method calls getAudioFileFormat(InputStream, long). Subclasses should not override this method unless there are really severe reasons. Normally, it is sufficient to implement getAudioFileFormat(InputStream, long).

Specified by:
getAudioFileFormat in class AudioFileReader
Parameters:
inputStream - the stream to read from.
Returns:
an AudioFileFormat instance containing information from the header of the stream passed in.
Throws:
UnsupportedAudioFileException
java.io.IOException

getAudioInputStream

public AudioInputStream getAudioInputStream(java.io.File file)
                                     throws UnsupportedAudioFileException,
                                            java.io.IOException
Get an AudioInputStream object for a file. This method calls getAudioInputStream(InputStream, long). Subclasses should not override this method unless there are really severe reasons. Normally, it is sufficient to implement getAudioFileFormat(InputStream, long) and perhaps override getAudioInputStream(InputStream, long).

Specified by:
getAudioInputStream in class AudioFileReader
Parameters:
file - the File object to read from.
Returns:
an AudioInputStream instance containing the audio data from this file.
Throws:
UnsupportedAudioFileException
java.io.IOException

getAudioInputStream

public AudioInputStream getAudioInputStream(java.net.URL url)
                                     throws UnsupportedAudioFileException,
                                            java.io.IOException
Get an AudioInputStream object for a URL. This method calls getAudioInputStream(InputStream, long). Subclasses should not override this method unless there are really severe reasons. Normally, it is sufficient to implement getAudioFileFormat(InputStream, long) and perhaps override getAudioInputStream(InputStream, long).

Specified by:
getAudioInputStream in class AudioFileReader
Parameters:
url - the URL to read from.
Returns:
an AudioInputStream instance containing the audio data from this URL.
Throws:
UnsupportedAudioFileException
java.io.IOException

getAudioInputStream

public AudioInputStream getAudioInputStream(java.io.InputStream inputStream)
                                     throws UnsupportedAudioFileException,
                                            java.io.IOException
Get an AudioInputStream object for an InputStream. This method calls getAudioInputStream(InputStream, long). Subclasses should not override this method unless there are really severe reasons. Normally, it is sufficient to implement getAudioFileFormat(InputStream, long) and perhaps override getAudioInputStream(InputStream, long).

Specified by:
getAudioInputStream in class AudioFileReader
Parameters:
inputStream - the stream to read from.
Returns:
an AudioInputStream instance containing the audio data from this stream.
Throws:
UnsupportedAudioFileException
java.io.IOException

readLittleEndianInt

public static int readLittleEndianInt(java.io.InputStream is)
                               throws java.io.IOException
Throws:
java.io.IOException

readLittleEndianShort

public static short readLittleEndianShort(java.io.InputStream is)
                                   throws java.io.IOException
Throws:
java.io.IOException

readIeeeExtended

public static double readIeeeExtended(java.io.DataInputStream dis)
                               throws java.io.IOException
Throws:
java.io.IOException