Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

MicrophoneDirection

public interface MicrophoneDirection

android.media.MicrophoneDirection


Summary

Constants

int MIC_DIRECTION_BACK

Optimize capture for audio coming from the side of the device opposite the screen.

int MIC_DIRECTION_EXTERNAL

Optimize capture for audio coming from an off-device microphone.

int MIC_DIRECTION_FRONT

Optimize capture for audio coming from the screen-side of the device.

int MIC_DIRECTION_UNSPECIFIED

Don't do any directionality processing of the activated microphone(s).

Public methods

abstract boolean setMicrophoneDirection(int direction)

Specifies the logical microphone (for processing).

abstract boolean setMicrophoneFieldDimension(float zoom)

Specifies the zoom factor (i.e.

Constants

MIC_DIRECTION_BACK

public static final int MIC_DIRECTION_BACK

Optimize capture for audio coming from the side of the device opposite the screen.

Constant Value: 2 (0x00000002)

MIC_DIRECTION_EXTERNAL

public static final int MIC_DIRECTION_EXTERNAL

Optimize capture for audio coming from an off-device microphone.

Constant Value: 3 (0x00000003)

MIC_DIRECTION_FRONT

public static final int MIC_DIRECTION_FRONT

Optimize capture for audio coming from the screen-side of the device.

Constant Value: 1 (0x00000001)

MIC_DIRECTION_UNSPECIFIED

public static final int MIC_DIRECTION_UNSPECIFIED

Don't do any directionality processing of the activated microphone(s).

Constant Value: 0 (0x00000000)

Public methods

setMicrophoneDirection

public abstract boolean setMicrophoneDirection (int direction)

Specifies the logical microphone (for processing).

Parameters
direction int: Direction constant. Value is MIC_DIRECTION_UNSPECIFIED, MIC_DIRECTION_FRONT, MIC_DIRECTION_BACK, or MIC_DIRECTION_EXTERNAL

Returns
boolean true if sucessful.

setMicrophoneFieldDimension

public abstract boolean setMicrophoneFieldDimension (float zoom)

Specifies the zoom factor (i.e. the field dimension) for the selected microphone (for processing). The selected microphone is determined by the use-case for the stream.

Parameters
zoom float: the desired field dimension of microphone capture. Range is from -1 (wide angle), though 0 (no zoom) to 1 (maximum zoom). Value is between -1.0 and 1.0 inclusive

Returns
boolean true if sucessful.