fi.helsinki.cs.ohtu.mpeg2.audio.mpa
Class MP2Frame

java.lang.Object
  extended by fi.helsinki.cs.ohtu.mpeg2.audio.mpa.MP2Frame
All Implemented Interfaces:
AudioFrame

public class MP2Frame
extends java.lang.Object
implements AudioFrame

Represents a frame of MPEG-1 Layer II coded data.


Field Summary
private  MP2Data data
           
private  MP123Header header
           
private  int paddingBits
           
 
Constructor Summary
MP2Frame(MP123Header header, MP2Data data, int paddingBits)
          Creates a new AudioFrame instance from given header, data and padding bits.
 
Method Summary
 double getDuration()
          Returns duration of this frame in seconds.
 void writeTo(BitOutputStream stream)
          Writes contents of this frame to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

header

private final MP123Header header

data

private final MP2Data data

paddingBits

private final int paddingBits
Constructor Detail

MP2Frame

public MP2Frame(MP123Header header,
                MP2Data data,
                int paddingBits)
Creates a new AudioFrame instance from given header, data and padding bits.

Parameters:
header - Audio frame header
data - Compressed audio data in binary form
paddingBits - Number of bits used for padding (filling bytes)
Method Detail

getDuration

public double getDuration()
Description copied from interface: AudioFrame
Returns duration of this frame in seconds.

Specified by:
getDuration in interface AudioFrame
Returns:
Duration of this frame in seconds

writeTo

public void writeTo(BitOutputStream stream)
             throws java.io.IOException
Description copied from interface: AudioFrame
Writes contents of this frame to the given stream.

Specified by:
writeTo in interface AudioFrame
Parameters:
stream - Stream to write this frame to
Throws:
java.io.IOException