Skip to main content
Version: 2.x

Class OdinVolumeComponent

Custom volume component for OdinNative.Wrapper.Media.CustomEffect . Recommend the use of AudioSource.volume or AudioMixer/AudioMixerGroup instead

This class is an effect in the odin audio pipeline to change audio buffers by amplify the volume level.

Declaration
[HelpURL("https://docs.4players.io/voice/unity/next/api/OdinNative.Unity.Audio/OdinVolumeComponent/")]
[AddComponentMenu("Odin/Audio/Effect/Volume")]
public class OdinVolumeComponent : 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

Volume

Declaration
[Range(0, 1)]
[Tooltip("Set sample volume: direct amplitude scale, or with Ldb the fader position on a dB-linear scale.")]
public float Volume

Ldb

Declaration
[Tooltip("Interpret Volume as a dB-linear fader (0..1 maps to -60dB..0dB) instead of a direct amplitude scale.")]
public bool Ldb

Methods

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