|
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.PortAudio
public final class PortAudio
PortAudio functions.
| Field Summary | |
|---|---|
static long |
FRAMES_PER_BUFFER_UNSPECIFIED
Can be passed as the framesPerBuffer parameter to Pa_OpenStream() or Pa_OpenDefaultStream() to indicate that the stream callback will accept buffers of any size. |
static double |
LATENCY_HIGH
Used when creating new stream parameters for suggested latency. |
static double |
LATENCY_LOW
Used when creating new stream parameters for suggested latency. |
static double |
LATENCY_UNSPECIFIED
Used when creating new stream parameters for suggested latency. |
static long |
SAMPLE_FORMAT_FLOAT32
A type used to specify one or more sample formats. |
static long |
SAMPLE_FORMAT_INT16
A type used to specify one or more sample formats. |
static long |
SAMPLE_FORMAT_INT24
A type used to specify one or more sample formats. |
static long |
SAMPLE_FORMAT_INT32
A type used to specify one or more sample formats. |
static long |
SAMPLE_FORMAT_INT8
A type used to specify one or more sample formats. |
static long |
SAMPLE_FORMAT_UINT8
A type used to specify one or more sample formats. |
static long |
STREAM_FLAGS_CLIP_OFF
Disable default clipping of out of range samples. |
static long |
STREAM_FLAGS_DITHER_OFF
Disable default dithering. |
static long |
STREAM_FLAGS_NEVER_DROP_INPUT
Flag requests that where possible a full duplex stream will not discard overflowed input samples without calling the stream callback. |
static long |
STREAM_FLAGS_NO_FLAG
Flags used to control the behavior of a stream. |
static long |
STREAM_FLAGS_PLATFORM_SPECIFIC_FLAGS
A mask specifying the platform specific bits. |
static long |
STREAM_FLAGS_PRIME_OUTPUT_BUFFERS_USING_STREAM_CALLBACK
Call the stream callback to fill initial output buffers, rather than the default behavior of priming the buffers with zeros (silence). |
| Method Summary | |
|---|---|
static void |
initialize()
Used to initialize the portaudio lib. |
static void |
Pa_AbortStream(long stream)
Terminates audio processing immediately without waiting for pending buffers to complete. |
static void |
Pa_CloseStream(long stream)
Closes an audio stream. |
static int |
Pa_GetDefaultInputDevice()
Retrieve the index of the default input device. |
static int |
Pa_GetDefaultOutputDevice()
Retrieve the index of the default output device. |
static int |
Pa_GetDeviceCount()
Retrieve the number of available devices. |
static long |
Pa_GetDeviceInfo(int deviceIndex)
Retrieve a pointer to a PaDeviceInfo structure containing information about the specified device. |
static long |
Pa_GetHostApiInfo(int hostApiIndex)
Retrieve a pointer to a structure containing information about a specific host Api. |
static int |
Pa_GetSampleSize(long format)
Retrieve the size of a given sample format in bytes. |
static long |
Pa_GetStreamReadAvailable(long stream)
Retrieve the number of frames that can be read from the stream without waiting. |
static long |
Pa_GetStreamWriteAvailable(long stream)
Retrieve the number of frames that can be written to the stream without waiting. |
static boolean |
Pa_IsFormatSupported(long inputParameters,
long outputParameters,
double sampleRate)
Determine whether it would be possible to open a stream with the specified parameters. |
static long |
Pa_OpenStream(long inputParameters,
long outputParameters,
double sampleRate,
long framesPerBuffer,
long streamFlags,
PortAudioStreamCallback streamCallback)
Opens a stream for either input, output or both. |
static void |
Pa_ReadStream(long stream,
byte[] buffer,
long frames)
Read samples from an input stream. |
static void |
Pa_StartStream(long stream)
Commences audio processing. |
static void |
Pa_StopStream(long stream)
Terminates audio processing. |
static void |
Pa_WriteStream(long stream,
byte[] buffer,
long frames)
Write samples to an output stream. |
static double |
PaDeviceInfo_getDefaultHighInputLatency(long deviceInfo)
Returns defaultHighInputLatency for the device. |
static double |
PaDeviceInfo_getDefaultHighOutputLatency(long deviceInfo)
Returns defaultHighOutputLatency for the device. |
static double |
PaDeviceInfo_getDefaultLowInputLatency(long deviceInfo)
Returns defaultLowInputLatency for the device. |
static double |
PaDeviceInfo_getDefaultLowOutputLatency(long deviceInfo)
Returns defaultLowOutputLatency for the device. |
static double |
PaDeviceInfo_getDefaultSampleRate(long deviceInfo)
The default samplerate for the deviec. |
static int |
PaDeviceInfo_getHostApi(long deviceInfo)
The host api of the device. |
static int |
PaDeviceInfo_getMaxInputChannels(long deviceInfo)
Maximum input channels for the device. |
static int |
PaDeviceInfo_getMaxOutputChannels(long deviceInfo)
Maximum output channels for the device. |
static String |
PaDeviceInfo_getName(long deviceInfo)
The name of the device. |
static int |
PaHostApiInfo_GetDefaultInputDevice(long hostApiInfo)
The default input device for this host API. |
static int |
PaHostApiInfo_GetDefaultOutputDevice(long hostApiInfo)
The default output device for this host API. |
static int |
PaHostApiInfo_GetDeviceCount(long hostApiInfo)
The number of devices belonging to this host API. |
static String |
PaHostApiInfo_GetName(long hostApiInfo)
A textual description of the host API for display on user interfaces. |
static int |
PaHostApiInfo_GetType(long hostApiInfo)
The well known unique identifier of this host API. |
static long |
PaStreamParameters_new(int deviceIndex,
int channelCount,
long sampleFormat,
double suggestedLatency)
Creates parameters used for opening streams. |
static void |
setEchoCancelParams(long inputStream,
long outputStream,
boolean enableDenoise,
boolean enableEchoCancel,
int frameSize,
int filterLength)
Set params for echocancel and turns on/off noise suppression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long FRAMES_PER_BUFFER_UNSPECIFIED
public static final long SAMPLE_FORMAT_INT16
public static final long SAMPLE_FORMAT_FLOAT32
public static final long SAMPLE_FORMAT_INT32
public static final long SAMPLE_FORMAT_INT24
public static final long SAMPLE_FORMAT_INT8
public static final long SAMPLE_FORMAT_UINT8
public static final long STREAM_FLAGS_NO_FLAG
public static final long STREAM_FLAGS_CLIP_OFF
public static final long STREAM_FLAGS_DITHER_OFF
public static final long STREAM_FLAGS_NEVER_DROP_INPUT
public static final long STREAM_FLAGS_PRIME_OUTPUT_BUFFERS_USING_STREAM_CALLBACK
public static final long STREAM_FLAGS_PLATFORM_SPECIFIC_FLAGS
public static final double LATENCY_UNSPECIFIED
public static final double LATENCY_HIGH
public static final double LATENCY_LOW
| Method Detail |
|---|
public static void initialize()
throws PortAudioException
PortAudioException - if error comes from portaudio.
public static void setEchoCancelParams(long inputStream,
long outputStream,
boolean enableDenoise,
boolean enableEchoCancel,
int frameSize,
int filterLength)
inputStream - the input stream.outputStream - the output stream.enableDenoise - is noise suppression enabled.enableEchoCancel - is echo cancel enabled.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)public static int Pa_GetDefaultInputDevice()
public static int Pa_GetDefaultOutputDevice()
public static void Pa_CloseStream(long stream)
throws PortAudioException
stream - the steam pointer.
PortAudioException
public static void Pa_AbortStream(long stream)
throws PortAudioException
stream - the steam pointer.
PortAudioException
public static int Pa_GetDeviceCount()
throws PortAudioException
PortAudioExceptionpublic static long Pa_GetDeviceInfo(int deviceIndex)
deviceIndex - the device index
public static long Pa_OpenStream(long inputParameters,
long outputParameters,
double sampleRate,
long framesPerBuffer,
long streamFlags,
PortAudioStreamCallback streamCallback)
throws PortAudioException
inputParameters - the input params or 0 if absent.outputParameters - the ouput params or 0 if absent.sampleRate - The desired sampleRate.framesPerBuffer - The number of frames passed to the stream
callback function, or the preferred block granularity for
a blocking read/write streamstreamFlags - Flags which modify the
behaviour of the streaming process.streamCallback - A pointer to a client supplied function that is
responsible for processing and filling input and output buffers.
If this parameter is NULL the stream will be opened in
'blocking read/write' mode.
PortAudioException
public static void Pa_StartStream(long stream)
throws PortAudioException
stream - pointer to the stream
PortAudioException
public static void Pa_StopStream(long stream)
throws PortAudioException
stream - pointer to the stream
PortAudioException
public static void Pa_WriteStream(long stream,
byte[] buffer,
long frames)
throws PortAudioException
stream - pointer to the streambuffer - A buffer of sample frames.frames - The number of frames to be written from buffer.
PortAudioException
public static void Pa_ReadStream(long stream,
byte[] buffer,
long frames)
throws PortAudioException
stream - pointer to the stream.buffer - a buffer of sample frames.frames - The number of frames to be read into buffer.
PortAudioExceptionpublic static long Pa_GetStreamReadAvailable(long stream)
stream - pointer to the stream.
public static long Pa_GetStreamWriteAvailable(long stream)
stream - pointer to the stream.
public static int Pa_GetSampleSize(long format)
format - the format.
public static boolean Pa_IsFormatSupported(long inputParameters,
long outputParameters,
double sampleRate)
inputParameters - A structure that describes the
input parameters used to open a stream.outputParameters - A structure that describes the output
parameters used to open a stream.sampleRate - The required sampleRate.
public static int PaDeviceInfo_getMaxInputChannels(long deviceInfo)
deviceInfo - device info pointer.
public static int PaDeviceInfo_getMaxOutputChannels(long deviceInfo)
deviceInfo - device info pointer.
public static String PaDeviceInfo_getName(long deviceInfo)
deviceInfo - device info pointer.
public static double PaDeviceInfo_getDefaultSampleRate(long deviceInfo)
deviceInfo - device info pointer.
public static int PaDeviceInfo_getHostApi(long deviceInfo)
deviceInfo - device info pointer.
public static double PaDeviceInfo_getDefaultLowInputLatency(long deviceInfo)
deviceInfo - device info pointer.
public static double PaDeviceInfo_getDefaultLowOutputLatency(long deviceInfo)
deviceInfo - device info pointer.
public static double PaDeviceInfo_getDefaultHighInputLatency(long deviceInfo)
deviceInfo - device info pointer.
public static double PaDeviceInfo_getDefaultHighOutputLatency(long deviceInfo)
deviceInfo - device info pointer.
public static long Pa_GetHostApiInfo(int hostApiIndex)
hostApiIndex - host api index.
public static int PaHostApiInfo_GetType(long hostApiInfo)
hostApiInfo - pointer to host api info structure.
public static String PaHostApiInfo_GetName(long hostApiInfo)
hostApiInfo - pointer to host api info structure.
public static int PaHostApiInfo_GetDeviceCount(long hostApiInfo)
hostApiInfo - pointer to host api info structure.
public static int PaHostApiInfo_GetDefaultInputDevice(long hostApiInfo)
hostApiInfo - pointer to host api info structure.
public static int PaHostApiInfo_GetDefaultOutputDevice(long hostApiInfo)
hostApiInfo - pointer to host api info structure.
public static long PaStreamParameters_new(int deviceIndex,
int channelCount,
long sampleFormat,
double suggestedLatency)
deviceIndex - the device.channelCount - the channels to be used.sampleFormat - the sample format.suggestedLatency - the suggested latency in milliseconds:
LATENCY_UNSPECIFIED -
use default(default high input/output latency)
LATENCY_HIGH - use default high input/output latency
LATENCY_LOW - use default low input/output latency
... - any other value in milliseconds (e.g. 0.1 is acceptable)
|
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 | |||||||||