Skip to main content
Version: 20 Mar 2024

Mic Muting

Module: Audio / Audio Definitions / Audio Output / Audio Input

More...

Functions

Name
MLResultMLAudioSetMicMute(bool is_muted)
Sets the global input mute state for all input streams.
MLResultMLAudioGetMicMute(bool * out_is_muted)
Queries the global input mute state for all input streams.
MLResultMLAudioSetMicMuteCallback(MLAudioMicMuteCallback callback, void * context)
Registers a callback for changes to the global input mute state.

Detailed Description

MIC MUTING.


Functions Documentation

MLAudioSetMicMute

MLResult MLAudioSetMicMute(
bool is_muted
)

Sets the global input mute state for all input streams.

Parameters

boolis_mutedIf true, capture streams will be muted globally.

Returns

MLResultMLResult_OkSuccessfully set the value.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • android.permission.RECORD_AUDIO (protection level: dangerous)

The global input mute applies to all input streams, including microphones, Virtual Capture and Mixed Capture. Any app with capture privileges can set it, and it will apply for all apps.


MLAudioGetMicMute

MLResult MLAudioGetMicMute(
bool * out_is_muted
)

Queries the global input mute state for all input streams.

Parameters

bool *out_is_mutedIf true, capture streams are muted globally.

Returns

MLResultMLResult_AllocFailedFailed due to memory allocation failure.
MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully retrieved the value.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • android.permission.RECORD_AUDIO (protection level: dangerous)

The global input mute applies to all input streams, including microphones, Virtual Capture and Mixed Capture. Any app with capture privileges can set it, and it will apply for all apps.

API Level:

  • 20

MLAudioSetMicMuteCallback

MLResult MLAudioSetMicMuteCallback(
MLAudioMicMuteCallback callback,
void * context
)

Registers a callback for changes to the global input mute state.

Parameters

MLAudioMicMuteCallbackcallbackCallback function pointer.
void *contextGeneric data pointer passed back through the callback.

Returns

MLResultMLResult_AllocFailedFailed due to memory allocation failure.
MLResultMLResult_OkSuccessfully registered the callback.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • android.permission.RECORD_AUDIO (protection level: dangerous)