Skip to main content
Version: 20 Mar 2024

NativeBindings

Native bindings for the MLWebRTC.AppDefinedAudioSource class.

Inherits from:
MagicLeapNativeBindings

Public Methods

MLResult.Code InitializeAppDefinedAudioSource

Initialized a given AppDefinedAudioSource object and sets it's callbacks.

public static MLResult.Code InitializeAppDefinedAudioSource(
MLWebRTC.AppDefinedAudioSource appDefinedAudioSource
)

Parameters

TypeNameDescription
MLWebRTC.AppDefinedAudioSourceappDefinedAudioSourceThe AppDefinedAudioSource object to initialize.

Returns: MLResult.Result will be MLResult.Code.Ok if the connection was successfully created. MLResult.Result will be MLResult.Code.PermissionDenied if necessary permission is missing. MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed due to other internal error.


MLResult.Code MLWebRTCSourceAppDefinedAudioSourcePushData

Creates the local source that links to the user's camera and mic.

public MLResult.Code MLWebRTCSourceAppDefinedAudioSourcePushData(
ulong sourceHandle,
in MLAudioOutput.NativeBindings.MLAudioBuffer audioBuffer,
in MLAudioOutput.NativeBindings.MLAudioBufferFormat audioBufferFormat
)

Parameters

TypeNameDescription
ulongsourceHandleThe handle to the local source to return to the caller.
in MLAudioOutput.NativeBindings.MLAudioBufferaudioBuffer
in MLAudioOutput.NativeBindings.MLAudioBufferFormataudioBufferFormat

Returns: MLResult.Result will be MLResult.Code.Ok if the local source was successfully created. MLResult.Result will be MLResult.Code.PermissionDenied if necessary permission is missing. MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed due to other internal error.


MLResult.Code PushData

public static MLResult.Code PushData(
ulong sourceHandle,
byte [] audioBuffer,
in MLAudioOutput.BufferFormat audioBufferFormat
)

Parameters

TypeNameDescription
ulongsourceHandle
byte []audioBuffer
in MLAudioOutput.BufferFormataudioBufferFormatBuffer format settings for input and output streams.

MLResult.Code PushData

public static MLResult.Code PushData(
ulong sourceHandle,
float [] audioBuffer,
in MLAudioOutput.BufferFormat audioBufferFormat
)

Parameters

TypeNameDescription
ulongsourceHandle
float []audioBuffer
in MLAudioOutput.BufferFormataudioBufferFormatBuffer format settings for input and output streams.