AudioProcessingOptions Class

  • java.lang.Object
    • com.microsoft.cognitiveservices.speech.audio.AudioProcessingOptions

Implements

java.lang.AutoCloseable

public class AudioProcessingOptions
implements java.lang.AutoCloseable

Represents audio processing options used with audio config class. Note: close() must be called in order to release underlying resources held by the object.

Method Summary

Modifier and Type Method and Description
void close()

Explicitly frees any external resource attached to the object.

static AudioProcessingOptions create(int audioProcessingFlags)

Creates an AudioProcessingOptions object with audio processing flags.

static AudioProcessingOptions create(int audioProcessingFlags, MicrophoneArrayGeometry microphoneArrayGeometry)

Creates an AudioProcessingOptions object with audio processing flags and custom microphone array geometry.

static AudioProcessingOptions create(int audioProcessingFlags, MicrophoneArrayGeometry microphoneArrayGeometry, SpeakerReferenceChannel speakerReferenceChannel)

Creates an AudioProcessingOptions object with audio processing flags, custom microphone array geometry and speaker reference channel position.

static AudioProcessingOptions create(int audioProcessingFlags, PresetMicrophoneArrayGeometry microphoneArrayGeometry)

Creates an AudioProcessingOptions object with audio processing flags and preset microphone array geometry.

static AudioProcessingOptions create(int audioProcessingFlags, PresetMicrophoneArrayGeometry microphoneArrayGeometry, SpeakerReferenceChannel speakerReferenceChannel)

Creates an AudioProcessingOptions object with audio processing flags, preset microphone array geometry and speaker reference channel position.

int getAudioProcessingFlags()

Returns the type of audio processing performed by Speech SDK.

int getBeamformingEndAngle()

Returns the end angle used for beamforming.

int getBeamformingStartAngle()

Returns the start angle used for beamforming.

SafeHandle getImpl()

Returns the audio processing options implementation.

MicrophoneArrayType getMicrophoneArrayType()

Returns the microphone array type of the microphone used for audio input.

MicrophoneCoordinates[] getMicrophoneCoordinates()

Returns the coordinates of microphones in the microphone array used for audio input.

PresetMicrophoneArrayGeometry getPresetMicrophoneArrayGeometry()

Returns the microphone array geometry of the microphone used for audio input.

SpeakerReferenceChannel getSpeakerReferenceChannel()

Returns the speaker reference channel position in the audio input.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

close

public void close()

Explicitly frees any external resource attached to the object.

create

public static AudioProcessingOptions create(int audioProcessingFlags)

Creates an AudioProcessingOptions object with audio processing flags. This method should only be used when the audio input is from a microphone array. On Windows, this method will try to query the microphone array geometry from the audio driver. Audio data is also read from speaker reference channel. On Linux, it assumes that the microphone is a single channel microphone.

Parameters:

audioProcessingFlags - Specifies flags to control the audio processing performed by Speech SDK. It is bitwise OR of constants from AudioProcessingConstants class.

Returns:

The audio processing options object being created.

create

public static AudioProcessingOptions create(int audioProcessingFlags, MicrophoneArrayGeometry microphoneArrayGeometry)

Creates an AudioProcessingOptions object with audio processing flags and custom microphone array geometry.

Parameters:

audioProcessingFlags - Specifies flags to control the audio processing performed by Speech SDK. It is bitwise OR of constants from AudioProcessingConstants class.
microphoneArrayGeometry - Specifies the microphone array geometry.

Returns:

The audio processing options object being created.

create

public static AudioProcessingOptions create(int audioProcessingFlags, MicrophoneArrayGeometry microphoneArrayGeometry, SpeakerReferenceChannel speakerReferenceChannel)

Creates an AudioProcessingOptions object with audio processing flags, custom microphone array geometry and speaker reference channel position.

Parameters:

audioProcessingFlags - Specifies flags to control the audio processing performed by Speech SDK. It is bitwise OR of constants from AudioProcessingConstants class.
microphoneArrayGeometry - Specifies the microphone array geometry.
speakerReferenceChannel - Specifies the speaker reference channel position in the input audio.

Returns:

The audio processing options object being created.

create

public static AudioProcessingOptions create(int audioProcessingFlags, PresetMicrophoneArrayGeometry microphoneArrayGeometry)

Creates an AudioProcessingOptions object with audio processing flags and preset microphone array geometry.

Parameters:

audioProcessingFlags - Specifies flags to control the audio processing performed by Speech SDK. It is bitwise OR of constants from AudioProcessingConstants class.
microphoneArrayGeometry - Specifies the type of microphone array geometry.

Returns:

The audio processing options object being created.

create

public static AudioProcessingOptions create(int audioProcessingFlags, PresetMicrophoneArrayGeometry microphoneArrayGeometry, SpeakerReferenceChannel speakerReferenceChannel)

Creates an AudioProcessingOptions object with audio processing flags, preset microphone array geometry and speaker reference channel position.

Parameters:

audioProcessingFlags - Specifies flags to control the audio processing performed by Speech SDK. It is bitwise OR of constants from AudioProcessingConstants class.
microphoneArrayGeometry - Specifies the type of microphone array geometry.
speakerReferenceChannel - Specifies the speaker reference channel position in the input audio.

Returns:

The audio processing options object being created.

getAudioProcessingFlags

public int getAudioProcessingFlags()

Returns the type of audio processing performed by Speech SDK.

Returns:

Bitwise OR of flags from AudioProcessingConstants class indicating the audio processing performed by Speech SDK.

getBeamformingEndAngle

public int getBeamformingEndAngle()

Returns the end angle used for beamforming.

Returns:

Beamforming end angle.

getBeamformingStartAngle

public int getBeamformingStartAngle()

Returns the start angle used for beamforming.

Returns:

Beamforming start angle.

getImpl

public SafeHandle getImpl()

Returns the audio processing options implementation.

Returns:

The implementation of the audio processing options.

getMicrophoneArrayType

public MicrophoneArrayType getMicrophoneArrayType()

Returns the microphone array type of the microphone used for audio input.

Returns:

Type of microphone array used for audio input.

getMicrophoneCoordinates

public MicrophoneCoordinates[] getMicrophoneCoordinates()

Returns the coordinates of microphones in the microphone array used for audio input.

Returns:

An array of MicrophoneCoordinates objects.

getPresetMicrophoneArrayGeometry

public PresetMicrophoneArrayGeometry getPresetMicrophoneArrayGeometry()

Returns the microphone array geometry of the microphone used for audio input.

Returns:

Microphone array geometry of the microphone used for audio input.

getSpeakerReferenceChannel

public SpeakerReferenceChannel getSpeakerReferenceChannel()

Returns the speaker reference channel position in the audio input.

Returns:

Speaker reference channel position in the audio input.

Applies to