|
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.media.protocol.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.
| Field Summary | |
|---|---|
(package private) int |
channels
|
(package private) double |
sampleRate
|
| 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. |
byte[] |
read()
Block and read a buffer from the stream. |
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 the stream operation if not already started and stores the slave inputstream that starts us. |
(package private) void |
stop(InputPortAudioStream slave)
Stops the PortAudio stream if requested by the last stream that uses us. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
double sampleRate
int channels
| 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 |
|---|
void start(InputPortAudioStream slave)
throws PortAudioException
PortAudioException
void stop(InputPortAudioStream slave)
throws PortAudioException
PortAudioExceptionpublic int getDeviceIndex()
public long getStream()
public byte[] read()
throws PortAudioException
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)
|
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 | |||||||||