Control
Module: Audio / Audio Definitions / Audio Output / Audio Input
Functions
Name | |
---|---|
MLResult | MLAudioStartInput(MLHandle handle) Starts a sound input. |
MLResult | MLAudioStopInput(MLHandle handle) Stops a sound input. |
MLResult | MLAudioGetInputState(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
MLHandle | handle | MLHandle of the sound input. |
Returns
MLResult | MLResult_Ok | Sound input is started, or continues if already playing. |
MLResult | MLResult_PermissionDenied | Failed due to lack of permission. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLAudioResult_HandleNotFound | Failed due to a missing handle. |
MLResult | MLAudioResult_NotImplemented | Failed 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
MLHandle | handle | MLHandle of the sound input. |
Returns
MLResult | MLResult_Ok | Sound input is stopped, or remains stopped if already stopped. |
MLResult | MLResult_PermissionDenied | Failed due to lack of permission. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLAudioResult_HandleNotFound | Failed due to a missing handle. |
MLResult | MLAudioResult_NotImplemented | Failed 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
MLHandle | handle | MLHandle of the sound input. |
MLAudioState * | out_state | MLAudioState enum of the sound input. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully retrieved the properties. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLAudioResult_HandleNotFound | Failed due to a missing handle. |
MLResult | MLAudioResult_NotImplemented | Failed 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.