fi.helsinki.cs.ohtu.mpeg2.audio.mpa
Class MP2Frame
java.lang.Object
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.
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 |
header
private final MP123Header header
data
private final MP2Data data
paddingBits
private final int paddingBits
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 headerdata
- Compressed audio data in binary formpaddingBits
- Number of bits used for padding (filling bytes)
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