NativeBindings
Native bindings for the MLWebRTC.AudioSink class.
Inherits from:
MagicLeapNativeBindings
Public Methods
MLResult.Code MLWebRTCAudioSinkCreate
Creates an audio sink.
public MLResult.Code MLWebRTCAudioSinkCreate(
out ulong sinkHandle
)
Parameters
Type | Name | Description |
---|---|---|
out ulong | sinkHandle | The handle to the audio sink to return to the caller. |
Returns: MLResult.Result will be MLResult.Code.Ok if the audio sink 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 MLWebRTCAudioSinkCreateEx
Creates an audio sink with the provided params.
public MLResult.Code MLWebRTCAudioSinkCreateEx(
ref MLWebRTCAudioSinkParams sinkParams,
out ulong sinkHandle
)
Parameters
Type | Name | Description |
---|---|---|
ref MLWebRTCAudioSinkParams | sinkParams | Parameters to use to create the audio sink. |
out ulong | sinkHandle | The handle to the audio sink to return to the caller. |
Returns: MLResult.Result will be MLResult.Code.Ok if the audio sink was successfully created. MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed due to other internal error.
MLResult.Code MLWebRTCAudioSinkDestroy
Destroys an audio sink.
public MLResult.Code MLWebRTCAudioSinkDestroy(
ulong sinkHandle
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.MismatchingHandle if an incorrect handle was sent. 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 MLWebRTCAudioSinkResetPosition
Resets the world position of an audio sink for spatialized audio.
public MLResult.Code MLWebRTCAudioSinkResetPosition(
ulong sinkHandle
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.MismatchingHandle if an incorrect handle was sent. 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 MLWebRTCAudioSinkSetCacheSize
Sets the number of milliseconds of audio that should be cached in the buffers before dropping the packets. Dictates the audio latency when app recovers from lifecycle state transitions like standby & reality. Default is 200ms.
public MLResult.Code MLWebRTCAudioSinkSetCacheSize(
ulong sinkHandle,
uint millisecondsToCache
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
uint | millisecondsToCache | How many milliseconds worth of audio to cache. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.MismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.UnspecifiedFailure if failed due to other internal error.
MLResult.Code MLWebRTCAudioSinkSetDirectSoundLevels
Sets the direct spatial sound send levels of an audio sink channel.
public MLResult.Code MLWebRTCAudioSinkSetDirectSoundLevels(
ulong sinkHandle,
ref MLWebRTCAudioSinkSoundLevels soundLevels
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ref MLWebRTCAudioSinkSoundLevels | soundLevels | The sound levels & channel to set the audio sink spatialization for. |
Returns: MLResult.Result will be MLResult.Code.Ok if spatialization settings were set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetPosition
Sets the world position of an audio sink for spatialized audio.
public MLResult.Code MLWebRTCAudioSinkSetPosition(
ulong sinkHandle,
in MagicLeapNativeBindings.MLVec3f position
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
in MagicLeapNativeBindings.MLVec3f | position | The position to set the audio sink to. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.MismatchingHandle if an incorrect handle was sent. 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 MLWebRTCAudioSinkSetPositionEx
Sets the world position of an audio sink channel.
public MLResult.Code MLWebRTCAudioSinkSetPositionEx(
ulong sinkHandle,
ref MLWebRTCAudioSinkPosition position
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ref MLWebRTCAudioSinkPosition | position | The position & channel to set the audio sink spatialization for. |
Returns: MLResult.Result will be MLResult.Code.Ok if spatialization settings were set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetRoomSoundLevels
Sets the room spatial sound send levels of an audio sink channel.
public MLResult.Code MLWebRTCAudioSinkSetRoomSoundLevels(
ulong sinkHandle,
ref MLWebRTCAudioSinkSoundLevels soundLevels
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ref MLWebRTCAudioSinkSoundLevels | soundLevels | The sound levels & channel to set the audio sink spatialization for. |
Returns: MLResult.Result will be MLResult.Code.Ok if spatialization settings were set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetSoundDistanceProperties
Sets the distance properties of an audio sink channel.
public MLResult.Code MLWebRTCAudioSinkSetSoundDistanceProperties(
ulong sinkHandle,
ref MLWebRTCAudioSinkSoundDistance soundDistance
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ref MLWebRTCAudioSinkSoundDistance | soundDistance | The sound distance & channel to set the audio sink spatialization for. |
Returns: MLResult.Result will be MLResult.Code.Ok if spatialization settings were set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetSoundOrientation
Sets the world orientation of an audio sink channel.
public MLResult.Code MLWebRTCAudioSinkSetSoundOrientation(
ulong sinkHandle,
ref MLWebRTCAudioSinkOrientation orientation
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ref MLWebRTCAudioSinkOrientation | orientation | The orientation & channel to set the audio sink spatialization for. |
Returns: MLResult.Result will be MLResult.Code.Ok if spatialization settings were set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetSoundRadiationProperties
Sets the radiation properties of an audio sink channel.
public MLResult.Code MLWebRTCAudioSinkSetSoundRadiationProperties(
ulong sinkHandle,
ref MLWebRTCAudioSinkSoundRadiation soundRadiation
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ref MLWebRTCAudioSinkSoundRadiation | soundRadiation | The sound radiation & channel to set the audio sink spatialization for. |
Returns: MLResult.Result will be MLResult.Code.Ok if spatialization settings were set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetSoundVolume
Sets the volume of an audio sink.
public MLResult.Code MLWebRTCAudioSinkSetSoundVolume(
ulong sinkHandle,
float volume
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
float | volume | The sink volume. |
Returns: MLResult.Result will be MLResult.Code.Ok if the volume was set successfully. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.InvalidParam if an incorrect param was sent.
MLResult.Code MLWebRTCAudioSinkSetSource
Sets the source of an audio sink.
public MLResult.Code MLWebRTCAudioSinkSetSource(
ulong sinkHandle,
ulong sourceHandle
)
Parameters
Type | Name | Description |
---|---|---|
ulong | sinkHandle | The handle to the audio sink. |
ulong | sourceHandle | The handle to the source to set onto the audio sink. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.MismatchingHandle if an incorrect handle was sent. 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.