Skip to main content
Version: 2.x

Class OdinMuteAudioComponent

Custom mute audio component for OdinNative.Wrapper.Media.CustomEffect

This class is an effect in the odin audio pipeline to mute based on the OdinNative.Unity.Audio.OdinMuteAudioComponent.SilenceToggle flag. The intention is to provide a convenient way with Unity Editor UI of Marshal a 1-byte signed integer bool for a specific audio packet in the current pipeline.

Declaration
[HelpURL("https://docs.4players.io/voice/unity/next/api/OdinNative.Unity.Audio/OdinMuteAudioComponent/")]
[AddComponentMenu("Odin/Audio/Effect/Mute Audio")]
public class OdinMuteAudioComponent : OdinCustomEffectUnityComponentBase<nint>, IOdinEffect

Inheritance: System.Object -> UnityEngine.Object -> UnityEngine.Component -> UnityEngine.Behaviour -> UnityEngine.MonoBehaviour -> OdinNative.Unity.Audio.OdinCustomEffectUnityComponentBase<U>

Implements:
OdinNative.Unity.Audio.IOdinEffect

Fields

SilenceToggle

Declaration
[Tooltip("Set \"is_silent\" flag to mute on native level. On false nothing will be set and the component does a simple passthrough.")]
public bool SilenceToggle

Methods

GetEffectUserData()

Get userdata used for the OdinNative.Unity.Audio.OdinCustomEffectUnityComponentBase

Declaration
public override nint GetEffectUserData()
Returns

System.IntPtr: effect userdata

CustomEffectCallback(OdinTArray<float>, ref bool, nint)

Callback delegate for the effect

Declaration
public override void CustomEffectCallback(NativeBindings.OdinTArray<float> audio, ref bool isSilent, nint _)
Parameters
TypeNameDescription
OdinNative.Core.Imports.NativeBindings.OdinTArray<T>audioaudio data wrapper for copy buffer to native
System.BooleanisSilentflag whether the buffer contains silence, can be set to mute the frame
System.IntPtr_effect userdata, see OdinNative.Unity.Audio.OdinCustomEffectUnityComponentBase

Implements