org.kc7bfi.jflac.sound.spi
Class FlacAudioFileReader

java.lang.Object
  extended by javax.sound.sampled.spi.AudioFileReader
      extended by org.kc7bfi.jflac.sound.spi.FlacAudioFileReader

public class FlacAudioFileReader
extends AudioFileReader

Provider for Flac audio file reading services. This implementation can parse the format information from Flac audio file, and can produce audio input streams from files of this type.

Version:
$Revision: 1.8 $
Author:
Marc Gimpel, Wimba S.A. (marc@wimba.com), Hendrik Schreiber

Constructor Summary
FlacAudioFileReader()
           
 
Method Summary
 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, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlacAudioFileReader

public FlacAudioFileReader()
Method Detail

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.

Specified by:
getAudioFileFormat in class AudioFileReader
Parameters:
file - the File from which file format information should be extracted.
Returns:
an AudioFileFormat object describing the audio file format.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

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.

Specified by:
getAudioFileFormat in class AudioFileReader
Parameters:
url - the URL for which the AudioInputStream should be constructed.
Returns:
an AudioInputStream object based on the audio file data pointed to by the URL.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

getAudioFileFormat

public AudioFileFormat getAudioFileFormat(InputStream stream)
                                   throws UnsupportedAudioFileException,
                                          IOException
Obtains an audio input stream from the input stream provided.

Specified by:
getAudioFileFormat in class AudioFileReader
Parameters:
stream - the input stream from which the AudioInputStream should be constructed.
Returns:
an AudioInputStream object based on the audio file data contained in the input stream.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

getAudioFileFormat

protected AudioFileFormat getAudioFileFormat(InputStream bitStream,
                                             int mediaLength)
                                      throws UnsupportedAudioFileException,
                                             IOException
Return the AudioFileFormat from the given InputStream. Implementation.

Parameters:
bitStream -
mediaLength -
Returns:
an AudioInputStream object based on the audio file data contained in the input stream.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

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.

Specified by:
getAudioInputStream in class AudioFileReader
Parameters:
file - the File for which the AudioInputStream should be constructed.
Returns:
an AudioInputStream object based on the audio file data pointed to by the File.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

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.

Specified by:
getAudioInputStream in class AudioFileReader
Parameters:
url - the URL for which the AudioInputStream should be constructed.
Returns:
an AudioInputStream object based on the audio file data pointed to by the URL.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

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.

Specified by:
getAudioInputStream in class AudioFileReader
Parameters:
stream - the input stream from which the AudioInputStream should be constructed.
Returns:
an AudioInputStream object based on the audio file data contained in the input stream.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.

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.

Parameters:
inputStream - the input stream from which the AudioInputStream should be constructed.
medialength -
Returns:
an AudioInputStream object based on the audio file data contained in the input stream.
Throws:
UnsupportedAudioFileException - if the File does not point to a valid audio file data recognized by the system.
IOException - if an I/O exception occurs.


Copyright © 2004-2011. All Rights Reserved.