Skip to main content
Version: 2.x

Class OdinMedia

Wrapper class of OdinNative.Wrapper.MediaDecoder for Unity (require AudioSource)

This convenient class provides predefined helper functions to cover for a default usecases where the voice chat needs to work with AudioSource, AudioClip, AudioMixer, ...

Default Unity GameObject altering functions:

Assembly: cs.temp.dll.dll
Declaration
public class OdinMedia : MonoBehaviour, IMedia

Implements:
OdinNative.Wrapper.Media.IMedia

Properties

OutSampleRate

Declaration
public int OutSampleRate { get; }

OutChannels

Gets the current speaker mode. Default is 2 channel stereo.

Declaration
public int OutChannels { get; }

Parent

Declaration
public IPeer Parent { get; set; }

Id

Declaration
public ushort Id { get; }

MediaDecoder

Media reference

Declaration
public MediaDecoder MediaDecoder { get; set; }

SpatialBlend

Property of AudioSource

Declaration
public float SpatialBlend { get; set; }

RolloffMode

Property of AudioSource

Declaration
public AudioRolloffMode RolloffMode { get; set; }

MinDistance

Property of AudioSource

Declaration
public float MinDistance { get; set; }

MaxDistance

Property of AudioSource

Declaration
public float MaxDistance { get; set; }

Activity

Media activity state flag

Declaration
public bool Activity { get; }

Fields

Playback

Actual Unity audio output component

Declaration
public AudioSource Playback

AudioMixerGroup

Unity mixer

Declaration
public AudioMixerGroup AudioMixerGroup

OnActiveStateChanged

Trigger on OdinNative.Unity.OdinMedia.Activity changed

Declaration
public MediaActiveStateChangedProxy OnActiveStateChanged

AutoDestroyAudioSource

Flag for destroy OdinNative.Unity.OdinMedia.Playback linked AudioSource

Declaration
public bool AutoDestroyAudioSource

AutoDestroyMediaStream

Flag for dispose of OdinNative.Unity.OdinMedia.MediaDecoder

Declaration
public bool AutoDestroyMediaStream

Methods

GetPipeline()

Declaration
public MediaPipeline GetPipeline()
Returns

Odin.MediaPipeline

AddApm()

Declaration
public virtual OdinApmComponent AddApm()
Returns

Odin.OdinApmComponent

AddVad()

Declaration
public virtual OdinVadComponent AddVad()
Returns

Odin.OdinVadComponent

AddVolumeBoost()

Declaration
public virtual OdinVolumeBoostComponent AddVolumeBoost()
Returns

Odin.OdinVolumeBoostComponent

AddMute()

Declaration
public virtual OdinMuteAudioComponent AddMute()
Returns

Odin.OdinMuteAudioComponent

AddEffect<T>()

Declaration
public T AddEffect<T>() where T : MonoBehaviour, IOdinEffect
Returns

<T>

Type Parameters
  • T

AddEffect<T>(T)

Declaration
public T AddEffect<T>(T effect) where T : MonoBehaviour, IOdinEffect
Returns

<T>

Parameters
TypeName
<T>effect
Type Parameters
  • T

AddEffect<T>(UnityAction<OdinArrayf, bool, T>, T)

Declaration
public CustomEffect<T> AddEffect<T>(UnityAction<OdinArrayf, bool, T> callback, T userData) where T : unmanaged
Returns

OdinNative.Wrapper.Media.CustomEffect<T>

Parameters
TypeName
Odin.UnityAction<OdinArrayf,System.Boolean,<T>>callback
<T>userData
Type Parameters
  • T

SetDecoder(MediaDecoder)

Declaration
public void SetDecoder(MediaDecoder decoder)
Parameters
TypeName
Odin.MediaDecoderdecoder

ReadOdinAudioData()

Declaration
public virtual void ReadOdinAudioData()

GetFrameBufferSize()

Declaration
public virtual float GetFrameBufferSize()
Returns

System.Single

CheckResetFrameBuffer(float)

Declaration
public virtual void CheckResetFrameBuffer(float audioBufferSize)
Parameters
TypeName
System.SingleaudioBufferSize

SetAudioSourcePtich(float)

Declaration
public virtual void SetAudioSourcePtich(float audioBufferSize)
Parameters
TypeName
System.SingleaudioBufferSize

SetAudioClipData()

Declaration
public virtual void SetAudioClipData()

Implements