audio
Class AudioBuffer

java.lang.Object
  extended by audio.AudioBuffer

public class AudioBuffer
extends java.lang.Object

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.


Field Summary
private  byte[] buf
           
private  long timestamp
           
private  boolean written
           
 
Constructor Summary
AudioBuffer(int size)
          Constructs buffer with given size.
 
Method Summary
 byte[] getByteArray()
          Gets buffer contents.
 long getTimestamp()
          Returns the time-stamp associated with the buffer
 boolean isWritten()
          Returns status of the flag 'written'
 void setRead()
          Resets the flag 'written'
 void setTimestamp(long timestamp)
          Associates time-stamp with the buffer.
 void setWritten()
          Sets the flag 'written'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

private byte[] buf

written

private boolean written

timestamp

private long timestamp
Constructor Detail

AudioBuffer

public AudioBuffer(int size)
Constructs buffer with given size.

Method Detail

getByteArray

public byte[] getByteArray()
Gets buffer contents.


isWritten

public boolean isWritten()
Returns status of the flag 'written'


setWritten

public void setWritten()
Sets the flag 'written'


setRead

public void setRead()
Resets the flag 'written'


getTimestamp

public long getTimestamp()
Returns the time-stamp associated with the buffer


setTimestamp

public void setTimestamp(long timestamp)
Associates time-stamp with the buffer.