Skip to main content
Version: 20 Mar 2024

Control

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

More...

Functions

Name
MLResultMLAudioStartInput(MLHandle handle)
Starts a sound input.
MLResultMLAudioStopInput(MLHandle handle)
Stops a sound input.
MLResultMLAudioGetInputState(MLHandle handle, MLAudioState * out_state)
Queries the activity state of a sound input.

Detailed Description

CONTROL.


Functions Documentation

MLAudioStartInput

MLResult MLAudioStartInput(
MLHandle handle
)

Starts a sound input.

Parameters

MLHandlehandleMLHandle of the sound input.

Returns

MLResultMLResult_OkSound input is started, or continues if already playing.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_HandleNotFoundFailed due to a missing handle.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

Calling this function on a playing input has no effect and returns success.


MLAudioStopInput

MLResult MLAudioStopInput(
MLHandle handle
)

Stops a sound input.

Parameters

MLHandlehandleMLHandle of the sound input.

Returns

MLResultMLResult_OkSound input is stopped, or remains stopped if already stopped.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_HandleNotFoundFailed due to a missing handle.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

Calling this function on a stopped input has no effect and returns success.


MLAudioGetInputState

MLResult MLAudioGetInputState(
MLHandle handle,
MLAudioState * out_state
)

Queries the activity state of a sound input.

Parameters

MLHandlehandleMLHandle of the sound input.
MLAudioState *out_stateMLAudioState enum of the sound input.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully retrieved the properties.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLAudioResult_HandleNotFoundFailed due to a missing handle.
MLResultMLAudioResult_NotImplementedFailed because feature has not been implemented yet.

Required Permissions:

  • None

The state of sound inputs can be either MLAudioState_Playing or MLAudioState_Stopped, depending on whether MLAudioStartInput or MLAudioStopInput was called most recently. When an input is stopped and restarted, its buffers are emptied and buffering begins again from a clean slate.