Public Member Functions | Private Attributes

audio.AudioBuffer Class Reference

Encapsulates the concept of an audio buffer with a time-stamp. More...

List of all members.

Public Member Functions

 AudioBuffer (int size)
 Constructs buffer with given size.
byte[] getByteArray ()
 Gets buffer contents.
boolean isWritten ()
 Returns status of the flag 'written'.
void setWritten ()
 Sets the flag 'written'.
void setRead ()
 Resets the flag 'written'.
long getTimestamp ()
 Returns the time-stamp associated with the buffer.
void setTimestamp (long timestamp)
 Associates time-stamp with the buffer.

Private Attributes

byte[] buf
boolean written
long timestamp

Detailed Description

Encapsulates the concept of an audio buffer with a time-stamp.

It also contains 'written' flag, which can be used to indicate whether there is written but unread data in the buffer.

Definition at line 9 of file AudioBuffer.java.


Constructor & Destructor Documentation

audio.AudioBuffer.AudioBuffer ( int  size )

Constructs buffer with given size.

Definition at line 18 of file AudioBuffer.java.

References audio.AudioBuffer.buf.

    {
        this.buf = new byte[ size ];
    }

Member Function Documentation

byte [] audio.AudioBuffer.getByteArray (  )
long audio.AudioBuffer.getTimestamp (  )

Returns the time-stamp associated with the buffer.

Definition at line 58 of file AudioBuffer.java.

References audio.AudioBuffer.timestamp.

Referenced by audio.AudioInterfacePCM.readWithTimestamp(), and audio.AudioInterfacePCM.writeBuffersToAudioOutput().

    {
        return timestamp;
    }
boolean audio.AudioBuffer.isWritten (  )

Returns status of the flag 'written'.

Definition at line 34 of file AudioBuffer.java.

References audio.AudioBuffer.written.

Referenced by audio.AudioInterfacePCM.micDataRead(), audio.AudioInterfacePCM.readWithTimestamp(), and audio.AudioInterfacePCM.writeBuffersToAudioOutput().

    {
        return this.written;
    }
void audio.AudioBuffer.setRead (  )
void audio.AudioBuffer.setTimestamp ( long  timestamp )

Associates time-stamp with the buffer.

Definition at line 66 of file AudioBuffer.java.

References audio.AudioBuffer.timestamp.

Referenced by audio.AudioInterfacePCM.micDataRead(), and audio.AudioInterfacePCM.writeBuffered().

    {
        this.timestamp = timestamp;
    }
void audio.AudioBuffer.setWritten (  )

Sets the flag 'written'.

Definition at line 42 of file AudioBuffer.java.

References audio.AudioBuffer.written.

Referenced by audio.AudioInterfacePCM.micDataRead(), and audio.AudioInterfacePCM.writeBuffered().

    {
        this.written = true;
    }

Member Data Documentation

byte [] audio.AudioBuffer.buf [private]
boolean audio.AudioBuffer.written [private]

The documentation for this class was generated from the following file: