Skip to main content
Version: 20 Mar 2024

Master Volume

Module: Audio / Audio Definitions / Audio Output / Acoustics

More...

Functions

Name
MLResultMLAudioGetMasterVolume(float * out_volume)
Queries the master volume.
MLResultMLAudioSetMasterVolumeCallback(MLAudioMasterVolumeChangedCallback callback, void * context)
Registers a callback for changes to the master volume.
MLResultMLAudioGetOutputMute(bool * out_is_muted)
Queries the state of the global output mute.
MLResultMLAudioSetOutputMuteCallback(MLAudioOutputMuteChangedCallback callback, void * context)
Registers a callback for changes to the global output mute.

Detailed Description

MASTER VOLUME.


Functions Documentation

MLAudioGetMasterVolume

MLResult MLAudioGetMasterVolume(
float * out_volume
)

Queries the master volume.

Parameters

float *out_volumeRetrieved master volume.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully retrieved the value.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

The range of the volume is 0-100, with 0 being silent and 100 being full volume.


MLAudioSetMasterVolumeCallback

MLResult MLAudioSetMasterVolumeCallback(
MLAudioMasterVolumeChangedCallback callback,
void * context
)

Registers a callback for changes to the master volume.

Parameters

MLAudioMasterVolumeChangedCallbackcallbackCallback 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_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

MLAudioGetOutputMute

MLResult MLAudioGetOutputMute(
bool * out_is_muted
)

Queries the state of the global output mute.

Parameters

bool *boolout_is_muted If true, global output is muted.

Returns

MLResultMLResult_OkSuccessfully retrieved the value.
MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown failure.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

API Level:

  • 20

MLAudioSetOutputMuteCallback

MLResult MLAudioSetOutputMuteCallback(
MLAudioOutputMuteChangedCallback callback,
void * context
)

Registers a callback for changes to the global output mute.

Parameters

MLAudioOutputMuteChangedCallbackcallbackCallback 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_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

API Level:

  • 8