Master Volume
Module: Audio / Audio Definitions / Audio Output / Acoustics
Functions
Name | |
---|---|
MLResult | MLAudioGetMasterVolume(float * out_volume) Queries the master volume. |
MLResult | MLAudioSetMasterVolumeCallback(MLAudioMasterVolumeChangedCallback callback, void * context) Registers a callback for changes to the master volume. |
MLResult | MLAudioGetOutputMute(bool * out_is_muted) Queries the state of the global output mute. |
MLResult | MLAudioSetOutputMuteCallback(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_volume | Retrieved master volume. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully retrieved the value. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLAudioResult_NotImplemented | Failed 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
MLAudioMasterVolumeChangedCallback | callback | Callback function pointer. |
void * | context | Generic data pointer passed back through the callback. |
Returns
MLResult | MLResult_AllocFailed | Failed due to memory allocation failure. |
MLResult | MLResult_Ok | Successfully registered the callback. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLAudioResult_NotImplemented | Failed 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 * | bool | out_is_muted If true, global output is muted. |
Returns
MLResult | MLResult_Ok | Successfully retrieved the value. |
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown failure. |
MLResult | MLAudioResult_NotImplemented | Failed 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
MLAudioOutputMuteChangedCallback | callback | Callback function pointer. |
void * | context | Generic data pointer passed back through the callback. |
Returns
MLResult | MLResult_AllocFailed | Failed due to memory allocation failure. |
MLResult | MLResult_Ok | Successfully registered the callback. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLAudioResult_NotImplemented | Failed because feature has not been implemented yet. |
Required Permissions:
- None
API Level:
- 8