org.jboss.media.format.audio.mpeg
Class MpegAudioHeader

java.lang.Object
  extended byorg.jboss.media.format.audio.mpeg.MpegAudioHeader
All Implemented Interfaces:
MediaHeader (src) , java.io.Serializable

public class MpegAudioHeader
extends java.lang.Object
implements MediaHeader (src)

Represents an MPEG Audio Header

See Also:
Serialized Form

Constructor Summary
MpegAudioHeader(java.io.InputStream data)
          Constructs a new instance and attempts to extract an MPEG audio header from mediaObject
 
Method Summary
 int getBitrate()
          Returns the bit rate for this media in kbps.
 MpegAudioFormat.ChannelMode (src) getChannelMode()
          Returns the channel mode for this MPEG audio.
 java.lang.Object getField(java.lang.String fieldname)
          Retreives a field by name.
 java.lang.String[] getFieldNames()
          Provides a list of the field names in this header
 MpegAudioFormat.Layer (src) getLayer()
          Returns the MPEG layer of this media
 int getSamplerate()
          Returns the sampling rate of this audio in Hz
 MpegAudioFormat.Version (src) getVersion()
          Returns the MPEG version of this media
 boolean isCopyright()
          Indicates whether this is copyrighted material or not
 boolean isOriginal()
          Indicates whether this is the orginal media, or a copy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MpegAudioHeader

public MpegAudioHeader(java.io.InputStream data)
                throws MediaException (src) ,
                       FormatSyntaxException (src) 
Constructs a new instance and attempts to extract an MPEG audio header from mediaObject

Throws:
MediaException (src) - if an there is an error accessing the media content
FormatSyntaxException (src) - if invalid data for this format is encoutered
RemoteException - if an RMI error occurs
Method Detail

getBitrate

public int getBitrate()
Returns the bit rate for this media in kbps.

Returns:
int the bit rate for this media

getChannelMode

public MpegAudioFormat.ChannelMode (src)  getChannelMode()
Returns the channel mode for this MPEG audio.

Returns:
MpegAudioFormat.ChannelMode the channel mode for this MPEG audio
See Also:
MpegAudioFormat.ChannelMode (src)

isCopyright

public boolean isCopyright()
Indicates whether this is copyrighted material or not

Returns:
boolean true if this is copyrighted material

getLayer

public MpegAudioFormat.Layer (src)  getLayer()
Returns the MPEG layer of this media

Returns:
MpegAudioFormat.Layer the MPEG audio layer of this media
See Also:
MpegAudioFormat (src) , MpegAudioFormat.Layer (src)

isOriginal

public boolean isOriginal()
Indicates whether this is the orginal media, or a copy

Returns:
boolean true if this is the orginal media

getSamplerate

public int getSamplerate()
Returns the sampling rate of this audio in Hz

Returns:
int the sampling rate of this audio

getVersion

public MpegAudioFormat.Version (src)  getVersion()
Returns the MPEG version of this media

Returns:
MpegAudioFormat.Version the MPEG version of this media
See Also:
MpegAudioFormat.Version (src)

getFieldNames

public java.lang.String[] getFieldNames()
Provides a list of the field names in this header

Specified by:
getFieldNames in interface MediaHeader (src)
Returns:
a list of the field names in this header
See Also:
MediaHeader.getFieldNames()

getField

public java.lang.Object getField(java.lang.String fieldname)
Retreives a field by name. In the case of primitive fields, the object equivalent is returned (e.g. int becomes java.lang.Integer

Specified by:
getField in interface MediaHeader (src)
Parameters:
fieldname - the name of the field to access
Returns:
the requested field, or null if the field name doesn't exist
See Also:
MediaHeader.getField(String)