Skip to main content
Version: 2.x

Class CustomActivityEffect

Custom activity detection effect for OdinNative.Wrapper.MediaPipeline callbacks.

Observes the isSilent flag emitted by the native pipeline on each audio frame without modifying the audio data or the silence state itself. Subscribe to OdinNative.Wrapper.Media.CustomActivityEffect.OnActivityChanged on the returned instance to receive per-frame silence state updates.

Declaration
public class CustomActivityEffect : PipelineEffect, IPipelineEffect, IDisposable

Inheritance: System.Object -> OdinNative.Wrapper.Media.PipelineEffect

Implements:
OdinNative.Wrapper.Media.IPipelineEffect, System.IDisposable

Properties

PeerId

Peer id passed through to OdinNative.Wrapper.Media.CustomActivityEffect.OnActivityChanged subscribers.

Declaration
public uint PeerId { get; set; }

MediaId

Media stream id passed through to OdinNative.Wrapper.Media.CustomActivityEffect.OnActivityChanged subscribers.

Declaration
public ulong MediaId { get; set; }

Methods

~CustomActivityEffect()

Declaration
protected ~CustomActivityEffect()

Dispose()

Frees the native callback handle. Must be called after removing the effect from its pipeline.

Declaration
public void Dispose()

Create(MediaPipeline, uint, ulong)

Insert a OdinNative.Wrapper.Media.CustomActivityEffect into the specified pipeline.

Declaration
public static CustomActivityEffect Create(MediaPipeline pipeline, uint peerId = 0, ulong mediaId = 0)
Returns

OdinNative.Wrapper.Media.CustomActivityEffect: instance of OdinNative.Wrapper.Media.CustomActivityEffect or null on failure

Parameters
TypeNameDescription
OdinNative.Wrapper.MediaPipelinepipelinepipeline to insert the effect into
System.UInt32peerIdpeer id passed through to OdinNative.Wrapper.Media.CustomActivityEffect.OnActivityChanged
System.UInt64mediaIdmedia id passed through to OdinNative.Wrapper.Media.CustomActivityEffect.OnActivityChanged

Events

OnActivityChanged

Raised when the silence state reported by the native pipeline changes. Subscribers must not modify the state. To silence audio use a dedicated mute effect instead.

Declaration
public event CustomActivityEffect.ActivityChangedDelegate OnActivityChanged
Event Type

OdinNative.Wrapper.Media.CustomActivityEffect.ActivityChangedDelegate

Implements