mediaframe.mpeg1
Class AudioFrame

java.lang.Object
  |
  +--mediaframe.mpeg1.DataFrame
        |
        +--mediaframe.mpeg1.AudioFrame

public class AudioFrame
extends DataFrame

The AudioFrame class represents one frame of audio data. It extends the DataFrame class and contains methods for reading the audio packet.


Field Summary
private  DataBuffer audioBuffer
          The buffer for audio data.
 
Fields inherited from class mediaframe.mpeg1.DataFrame
_eof, _time_stamp, _type, B_FRAME, file_position, GOP_START, I_FRAME, MASK, P_FRAME, SEQ_START, size, TYPE_AUDIO
 
Constructor Summary
AudioFrame(long time, DataBuffer audioBuffer)
          Constructs the AudioFrame object with the specified time stamp and the buffer for audio data (DataBuffer object).
 
Method Summary
 long fill(java.io.InputStream is, long next32)
          This routine reads audio data into the buffer from the input stream to byte which equals 1 or until the end of file will be reached.
 
Methods inherited from class mediaframe.mpeg1.DataFrame
getFilePosition, getFirstDataBlock, getTimeStamp, getType, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

audioBuffer

private DataBuffer audioBuffer
The buffer for audio data.

Constructor Detail

AudioFrame

public AudioFrame(long time,
                  DataBuffer audioBuffer)
Constructs the AudioFrame object with the specified time stamp and the buffer for audio data (DataBuffer object).

Parameters:
time - the time stamp of the frame.
audioBuffer - the buffer for audio data.
Method Detail

fill

public long fill(java.io.InputStream is,
                 long next32)
          throws java.lang.Exception
This routine reads audio data into the buffer from the input stream to byte which equals 1 or until the end of file will be reached.

Parameters:
is - the input stream with movie's data.
next32 - the last 4 bytes from the input stream.
Returns:
the last 4 bytes in the stream
java.lang.Exception