Class VoiceCaptureDSP
- java.lang.Object
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.wasapi.VoiceCaptureDSP
-
public class VoiceCaptureDSP extends Object
Defines the native interface of Voice Capture DSP as used by WASAPISystem and its associated CaptureDevice, DataSource and Renderer implementations.- Author:
- Lyubomir Marinov, Timothy Price
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLSID_CWMAudioAECstatic intDMO_E_NOTACCEPTINGstatic intDMO_INPUT_STATUSF_ACCEPT_DATAstatic intDMO_OUTPUT_DATA_BUFFERF_INCOMPLETEstatic intDMO_SET_TYPEF_TEST_ONLYstatic StringFORMAT_Nonestatic StringFORMAT_WaveFormatExstatic StringIID_IMediaObjectstatic StringIID_IPropertyStorestatic StringMEDIASUBTYPE_PCMstatic StringMEDIATYPE_Audiostatic longMFPKEY_WMAAECMA_DEVICE_INDEXESSpecifies which audio devices the Voice Capture DSP uses for capturing and rendering audio.static longMFPKEY_WMAAECMA_DMO_SOURCE_MODESpecifies whether the Voice Capture DSP uses source mode (true) or filter mode (false).static longMFPKEY_WMAAECMA_FEATR_AESSpecifies how many times the Voice Capture DSP performs acoustic echo suppression (AES) on the residual signal.static longMFPKEY_WMAAECMA_FEATR_AGCSpecifies whether the Voice Capture DSP performs automatic gain control.static longMFPKEY_WMAAECMA_FEATR_CENTER_CLIPSpecifies whether the Voice Capture DSP performs center clipping.static longMFPKEY_WMAAECMA_FEATR_ECHO_LENGTHSpecifies the duration of echo that the acoustic echo cancellation (AEC) algorithm can handle, in milliseconds.static longMFPKEY_WMAAECMA_FEATR_NOISE_FILLSpecifies whether the Voice Capture DSP performs noise filling.static longMFPKEY_WMAAECMA_FEATR_NSSpecifies whether the Voice Capture DSP performs noise suppression.static longMFPKEY_WMAAECMA_FEATURE_MODEEnables the application to override the default settings on various properties of the Voice Capture DSP.static longMFPKEY_WMAAECMA_MIC_GAIN_BOUNDERSpecifies whether the Voice Capture DSP applies microphone gain bounding.static longMFPKEY_WMAAECMA_SYSTEM_MODESpecifies the processing mode for the Voice Capture DSP.static intSINGLE_CHANNEL_AECThe value of the AEC_SYSTEM_MODE enumeration which is used with the MFPKEY_WMAAECMA_SYSTEM_MODE property to indicate that the Voice Capture DSP is to operate in acoustic echo cancellation (AEC) only mode.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intDMO_MEDIA_TYPE_fill(long thiz, String majortype, String subtype, boolean bFixedSizeSamples, boolean bTemporalCompression, int lSampleSize, String formattype, long pUnk, int cbFormat, long pbFormat)static voidDMO_MEDIA_TYPE_setCbFormat(long thiz, int cbFormat)static intDMO_MEDIA_TYPE_setFormattype(long thiz, String formattype)static voidDMO_MEDIA_TYPE_setLSampleSize(long thiz, int lSampleSize)static voidDMO_MEDIA_TYPE_setPbFormat(long thiz, long pbFormat)static longDMO_OUTPUT_DATA_BUFFER_alloc(long pBuffer, int dwStatus, long rtTimestamp, long rtTimelength)static intDMO_OUTPUT_DATA_BUFFER_getDwStatus(long thiz)static voidDMO_OUTPUT_DATA_BUFFER_setDwStatus(long thiz, int dwStatus)static intIMediaBuffer_AddRef(long thiz)static longIMediaBuffer_GetBuffer(long thiz)static intIMediaBuffer_GetLength(long thiz)static intIMediaBuffer_GetMaxLength(long thiz)static intIMediaBuffer_Release(long thiz)static voidIMediaBuffer_SetLength(long thiz, int cbLength)static intIMediaObject_Flush(long thiz)static intIMediaObject_GetInputStatus(long thiz, int dwInputStreamIndex)static intIMediaObject_ProcessInput(long thiz, int dwInputStreamIndex, long pBuffer, int dwFlags, long rtTimestamp, long rtTimelength)static intIMediaObject_ProcessOutput(long thiz, int dwFlags, int cOutputBufferCount, long pOutputBuffers)static longIMediaObject_QueryInterface(long thiz, String iid)static voidIMediaObject_Release(long thiz)static intIMediaObject_SetInputType(long thiz, int dwInputStreamIndex, long pmt, int dwFlags)static intIMediaObject_SetOutputType(long thiz, int dwOutputStreamIndex, long pmt, int dwFlags)static intIPropertyStore_SetValue(long thiz, long key, boolean value)static intIPropertyStore_SetValue(long thiz, long key, int value)static longMediaBuffer_alloc(int maxLength)static intMediaBuffer_pop(long thiz, byte[] buffer, int offset, int length)static intMediaBuffer_push(long thiz, byte[] buffer, int offset, int length)static longMoCreateMediaType(int cbFormat)static voidMoDeleteMediaType(long pmt)static voidMoFreeMediaType(long pmt)static voidMoInitMediaType(long pmt, int cbFormat)
-
-
-
Field Detail
-
CLSID_CWMAudioAEC
public static final String CLSID_CWMAudioAEC
- See Also:
- Constant Field Values
-
DMO_E_NOTACCEPTING
public static final int DMO_E_NOTACCEPTING
- See Also:
- Constant Field Values
-
DMO_INPUT_STATUSF_ACCEPT_DATA
public static final int DMO_INPUT_STATUSF_ACCEPT_DATA
- See Also:
- Constant Field Values
-
DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE
public static final int DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE
- See Also:
- Constant Field Values
-
DMO_SET_TYPEF_TEST_ONLY
public static final int DMO_SET_TYPEF_TEST_ONLY
- See Also:
- Constant Field Values
-
FORMAT_None
public static final String FORMAT_None
- See Also:
- Constant Field Values
-
FORMAT_WaveFormatEx
public static final String FORMAT_WaveFormatEx
- See Also:
- Constant Field Values
-
IID_IMediaObject
public static final String IID_IMediaObject
- See Also:
- Constant Field Values
-
IID_IPropertyStore
public static final String IID_IPropertyStore
- See Also:
- Constant Field Values
-
MEDIASUBTYPE_PCM
public static final String MEDIASUBTYPE_PCM
- See Also:
- Constant Field Values
-
MEDIATYPE_Audio
public static final String MEDIATYPE_Audio
- See Also:
- Constant Field Values
-
MFPKEY_WMAAECMA_DEVICE_INDEXES
public static final long MFPKEY_WMAAECMA_DEVICE_INDEXES
Specifies which audio devices the Voice Capture DSP uses for capturing and rendering audio. Set this property if you are using the DSP in source mode. The DSP ignores this property in filter mode. The value of the property is two 16-bit WORDs packed into a DWORD (i.e. a Java int). The upper 16 bits specify the audio rendering device (typically a speaker), and the lower 16 bits specify the capture device (typically a microphone). Each device is specified as an index into the audio device collection. If the index is -1, the default device is used.
-
MFPKEY_WMAAECMA_DMO_SOURCE_MODE
public static final long MFPKEY_WMAAECMA_DMO_SOURCE_MODE
Specifies whether the Voice Capture DSP uses source mode (true) or filter mode (false). In source mode, the application does not need to send input data to the DSP, because the DSP automatically pulls data from the audio devices. In filter mode, the application must send the input data to the DSP.
-
MFPKEY_WMAAECMA_FEATR_AES
public static final long MFPKEY_WMAAECMA_FEATR_AES
Specifies how many times the Voice Capture DSP performs acoustic echo suppression (AES) on the residual signal. The Voice Capture DSP can perform AES on the residual signal after echo cancellation. This int property can have the value 0, 1, or 2. The default value is 0. Before setting this property, you must set theMFPKEY_WMAAECMA_FEATURE_MODEproperty to true. The DSP uses this property only when AEC processing is enabled.
-
MFPKEY_WMAAECMA_FEATR_AGC
public static final long MFPKEY_WMAAECMA_FEATR_AGC
Specifies whether the Voice Capture DSP performs automatic gain control. Automatic gain control is a digital signal processing (DSP) component that adjusts the gain so that the output level of the signal remains within the same approximate range. The default value of this property is false (i.e. disabled). Before setting this property, you must set theMFPKEY_WMAAECMA_FEATURE_MODEproperty to true.
-
MFPKEY_WMAAECMA_FEATR_CENTER_CLIP
public static final long MFPKEY_WMAAECMA_FEATR_CENTER_CLIP
Specifies whether the Voice Capture DSP performs center clipping. Center clipping is a process that removes small echo residuals that remain after AEC processing, in single-talk situations (when speech occurs only on one end of the line). The default value of this property is true (i.e. enabled). Before setting this property, you must set theMFPKEY_WMAAECMA_FEATURE_MODEproperty to true. The DSP uses this property only when AEC processing is enabled.
-
MFPKEY_WMAAECMA_FEATR_ECHO_LENGTH
public static final long MFPKEY_WMAAECMA_FEATR_ECHO_LENGTH
Specifies the duration of echo that the acoustic echo cancellation (AEC) algorithm can handle, in milliseconds. The AEC algorithm uses an adaptive filter whose length is determined by the duration of the echo. It is recommended that applications use one of the following int values: 128, 256, 512, 1024. The default value is 256 milliseconds, which is sufficient for most office and home environments. Before setting this property, you must set theMFPKEY_WMAAECMA_FEATURE_MODEproperty to true. The DSP uses this property only when AEC processing is enabled.
-
MFPKEY_WMAAECMA_FEATR_NOISE_FILL
public static final long MFPKEY_WMAAECMA_FEATR_NOISE_FILL
Specifies whether the Voice Capture DSP performs noise filling. Noise filling adds a small amount of noise to portions of the signal where center clipping has removed the residual echoes. This results in a better experience for the user than leaving silent gaps in the signal. The default value of this property is true (i.e. enabled). Before setting this property, you must set theMFPKEY_WMAAECMA_FEATURE_MODEproperty to true. The DSP uses this property only when AEC processing is enabled.
-
MFPKEY_WMAAECMA_FEATR_NS
public static final long MFPKEY_WMAAECMA_FEATR_NS
Specifies whether the Voice Capture DSP performs noise suppression. Noise suppression is a digital signal processing (DSP) component that suppresses or reduces stationary background noise in the audio signal. Noise suppression is applied after the acoustic echo cancellation (AEC) and microphone array processing. The property can have the following int values: 0 to disable noise suppression or 1 to enable noise suppression. The default value of this property is 1 (i.e. enabled). Before setting this property, you must set theMFPKEY_WMAAECMA_FEATURE_MODEproperty to true.
-
MFPKEY_WMAAECMA_FEATURE_MODE
public static final long MFPKEY_WMAAECMA_FEATURE_MODE
Enables the application to override the default settings on various properties of the Voice Capture DSP. If this property is true, the application can set the MFPKEY_WMAAECMA_FEATR_XXX properties on the DSP. If this property is false, the DSP ignores these properties and uses its default settings. The default value of this property is false.
-
MFPKEY_WMAAECMA_MIC_GAIN_BOUNDER
public static final long MFPKEY_WMAAECMA_MIC_GAIN_BOUNDER
Specifies whether the Voice Capture DSP applies microphone gain bounding. Microphone gain bounding ensures that the microphone has the correct level of gain. If gain is too high, the captured signal might be saturated and will be clipped. Clipping is a non-linear effect, which will cause the acoustic echo cancellation (AEC) algorithm to fail. If the gain is too low, the signal-to-noise ratio is low, which can also cause the AEC algorithm to fail or not perform well. The default value of this boolean property is true. Microphone gain bounding is applied only when the DSP operates in source mode. In filter mode, the application must ensure that the microphone has the correct gain level. In order to disable automatic gain control (AGC), microphone gain bounding must also be disabled.
-
MFPKEY_WMAAECMA_SYSTEM_MODE
public static final long MFPKEY_WMAAECMA_SYSTEM_MODE
Specifies the processing mode for the Voice Capture DSP.- See Also:
SINGLE_CHANNEL_AEC
-
SINGLE_CHANNEL_AEC
public static final int SINGLE_CHANNEL_AEC
The value of the AEC_SYSTEM_MODE enumeration which is used with the MFPKEY_WMAAECMA_SYSTEM_MODE property to indicate that the Voice Capture DSP is to operate in acoustic echo cancellation (AEC) only mode.- See Also:
- Constant Field Values
-
-
Method Detail
-
DMO_MEDIA_TYPE_fill
public static int DMO_MEDIA_TYPE_fill(long thiz, String majortype, String subtype, boolean bFixedSizeSamples, boolean bTemporalCompression, int lSampleSize, String formattype, long pUnk, int cbFormat, long pbFormat) throws HResultException- Throws:
HResultException
-
DMO_MEDIA_TYPE_setCbFormat
public static void DMO_MEDIA_TYPE_setCbFormat(long thiz, int cbFormat)
-
DMO_MEDIA_TYPE_setFormattype
public static int DMO_MEDIA_TYPE_setFormattype(long thiz, String formattype) throws HResultException- Throws:
HResultException
-
DMO_MEDIA_TYPE_setLSampleSize
public static void DMO_MEDIA_TYPE_setLSampleSize(long thiz, int lSampleSize)
-
DMO_MEDIA_TYPE_setPbFormat
public static void DMO_MEDIA_TYPE_setPbFormat(long thiz, long pbFormat)
-
DMO_OUTPUT_DATA_BUFFER_alloc
public static long DMO_OUTPUT_DATA_BUFFER_alloc(long pBuffer, int dwStatus, long rtTimestamp, long rtTimelength)
-
DMO_OUTPUT_DATA_BUFFER_getDwStatus
public static int DMO_OUTPUT_DATA_BUFFER_getDwStatus(long thiz)
-
DMO_OUTPUT_DATA_BUFFER_setDwStatus
public static void DMO_OUTPUT_DATA_BUFFER_setDwStatus(long thiz, int dwStatus)
-
IMediaBuffer_AddRef
public static int IMediaBuffer_AddRef(long thiz)
-
IMediaBuffer_GetBuffer
public static long IMediaBuffer_GetBuffer(long thiz) throws HResultException- Throws:
HResultException
-
IMediaBuffer_GetLength
public static int IMediaBuffer_GetLength(long thiz) throws HResultException- Throws:
HResultException
-
IMediaBuffer_GetMaxLength
public static int IMediaBuffer_GetMaxLength(long thiz) throws HResultException- Throws:
HResultException
-
IMediaBuffer_Release
public static int IMediaBuffer_Release(long thiz)
-
IMediaBuffer_SetLength
public static void IMediaBuffer_SetLength(long thiz, int cbLength) throws HResultException- Throws:
HResultException
-
IMediaObject_Flush
public static int IMediaObject_Flush(long thiz) throws HResultException- Throws:
HResultException
-
IMediaObject_GetInputStatus
public static int IMediaObject_GetInputStatus(long thiz, int dwInputStreamIndex) throws HResultException- Throws:
HResultException
-
IMediaObject_ProcessInput
public static int IMediaObject_ProcessInput(long thiz, int dwInputStreamIndex, long pBuffer, int dwFlags, long rtTimestamp, long rtTimelength) throws HResultException- Throws:
HResultException
-
IMediaObject_ProcessOutput
public static int IMediaObject_ProcessOutput(long thiz, int dwFlags, int cOutputBufferCount, long pOutputBuffers) throws HResultException- Throws:
HResultException
-
IMediaObject_QueryInterface
public static long IMediaObject_QueryInterface(long thiz, String iid) throws HResultException- Throws:
HResultException
-
IMediaObject_Release
public static void IMediaObject_Release(long thiz)
-
IMediaObject_SetInputType
public static int IMediaObject_SetInputType(long thiz, int dwInputStreamIndex, long pmt, int dwFlags) throws HResultException- Throws:
HResultException
-
IMediaObject_SetOutputType
public static int IMediaObject_SetOutputType(long thiz, int dwOutputStreamIndex, long pmt, int dwFlags) throws HResultException- Throws:
HResultException
-
IPropertyStore_SetValue
public static int IPropertyStore_SetValue(long thiz, long key, boolean value) throws HResultException- Throws:
HResultException
-
IPropertyStore_SetValue
public static int IPropertyStore_SetValue(long thiz, long key, int value) throws HResultException- Throws:
HResultException
-
MediaBuffer_alloc
public static long MediaBuffer_alloc(int maxLength)
-
MediaBuffer_pop
public static int MediaBuffer_pop(long thiz, byte[] buffer, int offset, int length) throws HResultException- Throws:
HResultException
-
MediaBuffer_push
public static int MediaBuffer_push(long thiz, byte[] buffer, int offset, int length) throws HResultException- Throws:
HResultException
-
MoCreateMediaType
public static long MoCreateMediaType(int cbFormat) throws HResultException- Throws:
HResultException
-
MoDeleteMediaType
public static void MoDeleteMediaType(long pmt) throws HResultException- Throws:
HResultException
-
MoFreeMediaType
public static void MoFreeMediaType(long pmt) throws HResultException- Throws:
HResultException
-
MoInitMediaType
public static void MoInitMediaType(long pmt, int cbFormat) throws HResultException- Throws:
HResultException
-
-