|
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.PortAudioManager
public class PortAudioManager
Manages PortAudio stream creation and setting necessary properties when using them.
| Field Summary | |
|---|---|
static int |
NUM_SAMPLES
20ms in 8kHz is 160 samples. |
| Method Summary | |
|---|---|
int |
getFilterLength()
Number of samples of echo to cancel (should generally correspond to 100-500 ms) |
int |
getFrameSize()
Number of samples to process at one time (should correspond to 10-20 ms). |
InputPortAudioStream |
getInputStream(int deviceIndex,
double sampleRate,
int channels)
Creates input stream from the device with given index. |
static PortAudioManager |
getInstance()
Gets the only instance of PortAudioManager, if its not already created will be created. |
OutputPortAudioStream |
getOutputStream(int deviceIndex,
double sampleRate,
int channels)
Creates output stream from the device with given index. |
OutputPortAudioStream |
getOutputStream(int deviceIndex,
double sampleRate,
int channels,
long sampleFormat)
Creates output stream from the device with given index. |
static double |
getSuggestedLatency()
Returns the default values of the latency to be used when openning new streams. |
boolean |
isEnabledDeNoise()
Is noise reduction enabled. |
boolean |
isEnabledEchoCancel()
Is echo cancel enabled. |
void |
setDeNoise(boolean enabled)
Enables or disables noise suppression. |
void |
setEchoCancel(boolean enabled,
int frameSize,
int filterLength)
Enables or disables echo cancel. |
static void |
setSuggestedLatency(double aSuggestedLatency)
Changes the suggested latency. |
void |
stoppedInputPortAudioStream(MasterPortAudioStream st)
Input stream is stopped. |
void |
stoppedOutputPortAudioStream(OutputPortAudioStream st)
Output stream is stopped. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NUM_SAMPLES
| Method Detail |
|---|
public static PortAudioManager getInstance()
throws PortAudioException
PortAudioException - if portaudio cannot be initialized for
some reason.
public InputPortAudioStream getInputStream(int deviceIndex,
double sampleRate,
int channels)
throws PortAudioException
deviceIndex - the device index.sampleRate - the sample rate to use, its the sample rate of the
input stream.channels - the channels that the stream will serve.
PortAudioException - if opening of the stream failes.
public OutputPortAudioStream getOutputStream(int deviceIndex,
double sampleRate,
int channels)
throws PortAudioException
deviceIndex - the device index.sampleRate - the sample rate to use, its the sample rate of the
output stream.channels - the channels that the stream will serve.
PortAudioException - if opening of the stream failes.public void stoppedOutputPortAudioStream(OutputPortAudioStream st)
st - the stream that is stopped.public void stoppedInputPortAudioStream(MasterPortAudioStream st)
st - the input stream that is stopped.
public OutputPortAudioStream getOutputStream(int deviceIndex,
double sampleRate,
int channels,
long sampleFormat)
throws PortAudioException
deviceIndex - the device index.sampleRate - the sample rate to use, its the sample rate of the
output stream.channels - the channels that the stream will serve.sampleFormat - the format the will be used by the stream.
PortAudioException - if opening of the stream failes.
public void setEchoCancel(boolean enabled,
int frameSize,
int filterLength)
enabled - should we enable or disable echo cancelationframeSize - 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)public void setDeNoise(boolean enabled)
enabled - should we enable or disable noise suppression.public static double getSuggestedLatency()
public static void setSuggestedLatency(double aSuggestedLatency)
aSuggestedLatency - the suggestedLatency to set.public boolean isEnabledEchoCancel()
public boolean isEnabledDeNoise()
public int getFrameSize()
public int getFilterLength()
|
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 | |||||||||