SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media.protocol.portaudio.streams
Class InputPortAudioStream

java.lang.Object
  extended by net.java.sip.communicator.impl.media.protocol.portaudio.streams.InputPortAudioStream

public class InputPortAudioStream
extends Object

The input audio stream.

Author:
Damian Minkov

Field Summary
protected  byte[] buffer
          The buffer to return.
 
Constructor Summary
InputPortAudioStream(MasterPortAudioStream st)
          Creates new input stream (slave) with master input stream.
 
Method Summary
 byte[] read()
          Block and read a buffer from the stream if there is no buffer.
 void setBuffer(byte[] buffer)
          The parent can set a buffer that was requested and read by other slave stream.
 void start()
          Starts the stream.
 void stop()
          Stops the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected byte[] buffer
The buffer to return.

Constructor Detail

InputPortAudioStream

public InputPortAudioStream(MasterPortAudioStream st)
Creates new input stream (slave) with master input stream.

Parameters:
st - the parent(master) input stream.
Method Detail

read

public byte[] read()
            throws PortAudioException
Block and read a buffer from the stream if there is no buffer.

Returns:
the bytes that a read from underlying stream.
Throws:
PortAudioException - if an error occurs while reading.

start

public void start()
           throws PortAudioException
Starts the stream. Also starts the parent stream if its not already started.

Throws:
PortAudioException - if stream cannot be started.

stop

public void stop()
          throws PortAudioException
Stops the stream. Also stops the parent if we are the last slave stream that use it.

Throws:
PortAudioException

setBuffer

public void setBuffer(byte[] buffer)
The parent can set a buffer that was requested and read by other slave stream.

Parameters:
buffer - the buffer to set.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.