Class 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 Detail

      • 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
      • 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 the MFPKEY_WMAAECMA_FEATURE_MODE property 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 the MFPKEY_WMAAECMA_FEATURE_MODE property 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 the MFPKEY_WMAAECMA_FEATURE_MODE property 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 the MFPKEY_WMAAECMA_FEATURE_MODE property 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 the MFPKEY_WMAAECMA_FEATURE_MODE property 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 the MFPKEY_WMAAECMA_FEATURE_MODE property 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_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_Release

        public static int IMediaBuffer_Release​(long thiz)
      • 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_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
      • MediaBuffer_alloc

        public static long MediaBuffer_alloc​(int maxLength)
      • MediaBuffer_push

        public static int MediaBuffer_push​(long thiz,
                                           byte[] buffer,
                                           int offset,
                                           int length)
                                    throws HResultException
        Throws:
        HResultException