org.jaudiotagger.audio.asf
Class AsfFileReader

java.lang.Object
  extended by org.jaudiotagger.audio.generic.AudioFileReader
      extended by org.jaudiotagger.audio.asf.AsfFileReader

public class AsfFileReader
extends AudioFileReader

This reader can read ASF files containing any content (stream type).

Author:
Christian Laireiter

Field Summary
private static AsfHeaderReader HEADER_READER
          This reader will be configured to read tag and audio header information.
private static java.util.logging.Logger LOGGER
          Logger instance
 
Fields inherited from class org.jaudiotagger.audio.generic.AudioFileReader
logger
 
Constructor Summary
AsfFileReader()
           
 
Method Summary
private  boolean determineVariableBitrate(AsfHeader header)
          Determines if the "isVbr" field is set in the extended content description.
private  GenericAudioHeader getAudioHeader(AsfHeader header)
          Creates a generic audio header instance with provided data from header.
protected  GenericAudioHeader getEncodingInfo(java.io.RandomAccessFile raf)
          (overridden)
private  AsfTag getTag(AsfHeader header)
          Creates a tag instance with provided data from header.
protected  AsfTag getTag(java.io.RandomAccessFile raf)
          (overridden)
 AudioFile read(java.io.File f)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final java.util.logging.Logger LOGGER
Logger instance


HEADER_READER

private static final AsfHeaderReader HEADER_READER
This reader will be configured to read tag and audio header information.

Constructor Detail

AsfFileReader

public AsfFileReader()
Method Detail

determineVariableBitrate

private boolean determineVariableBitrate(AsfHeader header)
Determines if the "isVbr" field is set in the extended content description.

Parameters:
header - the header to look up.
Returns:
true if "isVbr" is present with a true value.

getAudioHeader

private GenericAudioHeader getAudioHeader(AsfHeader header)
                                   throws CannotReadException
Creates a generic audio header instance with provided data from header.

Parameters:
header - ASF header which contains the information.
Returns:
generic audio header representation.
Throws:
CannotReadException - If header does not contain mandatory information. (Audio stream chunk and file header chunk)

getEncodingInfo

protected GenericAudioHeader getEncodingInfo(java.io.RandomAccessFile raf)
                                      throws CannotReadException,
                                             java.io.IOException
(overridden)

Specified by:
getEncodingInfo in class AudioFileReader
Throws:
CannotReadException
java.io.IOException
See Also:
AudioFileReader.getEncodingInfo(java.io.RandomAccessFile)

getTag

private AsfTag getTag(AsfHeader header)
Creates a tag instance with provided data from header.

Parameters:
header - ASF header which contains the information.
Returns:
generic audio header representation.

getTag

protected AsfTag getTag(java.io.RandomAccessFile raf)
                 throws CannotReadException,
                        java.io.IOException
(overridden)

Specified by:
getTag in class AudioFileReader
Throws:
CannotReadException
java.io.IOException
See Also:
AudioFileReader.getTag(java.io.RandomAccessFile)

read

public AudioFile read(java.io.File f)
               throws CannotReadException,
                      java.io.IOException,
                      TagException,
                      ReadOnlyFileException,
                      InvalidAudioFrameException

Overrides:
read in class AudioFileReader
Throws:
CannotReadException
java.io.IOException
TagException
ReadOnlyFileException
InvalidAudioFrameException