|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.portaudio.streams.MasterPortAudioStream
public class MasterPortAudioStream
The master audio stream which opens the PortAudio stream and reads from it. We can have multiple slave input streams that are connected to this master stream.
| Constructor Summary | |
|---|---|
MasterPortAudioStream(int deviceIndex,
double sampleRate,
int channels)
Creates new stream. |
|
| Method Summary | |
|---|---|
int |
getDeviceIndex()
Returns the index of the device that we use. |
long |
getStream()
Returns the pointer to the stream that we use for reading. |
boolean |
read(javax.media.Buffer buffer)
Reads audio data from this MasterPortAudioStream into a specific Buffer blocking until audio data is indeed available. |
void |
setParams(OutputPortAudioStream out,
boolean deNoiseEnabled,
boolean echoCancelEnabled,
int frameSize,
int filterLength)
Sets parameters to the underlying stream. |
(package private) void |
start(InputPortAudioStream slave)
Starts this MasterPortAudioStream so that a specific InputPortAudioStream can read from it. |
(package private) void |
stop(InputPortAudioStream slave)
Stops the reading of a specific InputPortAudioStream from this MasterPortAudioStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MasterPortAudioStream(int deviceIndex,
double sampleRate,
int channels)
throws PortAudioException
deviceIndex - the device to use.channels - the channels to serve.sampleRate - the sample rate.
PortAudioException - if stream cannot be opened.| Method Detail |
|---|
public int getDeviceIndex()
public long getStream()
public boolean read(javax.media.Buffer buffer)
throws PortAudioException
buffer - the Buffer into which the audio data read from
this MasterPortAudioStream is to be returned
PortAudioException - if an error occurs while reading
public void setParams(OutputPortAudioStream out,
boolean deNoiseEnabled,
boolean echoCancelEnabled,
int frameSize,
int filterLength)
out - the connected output stream if echo cancel is enabled.deNoiseEnabled - true if we want to enable noise reduction.echoCancelEnabled - true to enable echo cancel.frameSize - Number of samples to process at one time
(should correspond to 10-20 ms).filterLength - Number of samples of echo to cancel
(should generally correspond to 100-500 ms)
void start(InputPortAudioStream slave)
throws PortAudioException
slave - the InputPortAudioStream which has been started
and wants to read audio from this instance
PortAudioException - if anything wrong happens while starting the
native PortAudio stream this instance is to read from
void stop(InputPortAudioStream slave)
throws PortAudioException
slave - the InputPortAudioStream which has been stopped and
no longer wants to read audio from this instance
PortAudioException - if anything wrong happens while stopping the
native PortAudio stream this instance reads from
|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||