UOdinCustomEffect
Codec-Effect base for the odin audio pipeline. The effect does nothing by itself.
OdinCustomEffects registered with odin_pipeline_insert_custom_effect are executed in a native library caller thread of that codec pipeline and are blocking pop functions. The corresponding codec push function is not blocked. Heavy computational task in an effect will reduce performance.
- Header:
#include "OdinAudio/Effects/OdinCustomEffect.h" - Module:
Odin - Inherits from:
UObject - Derived classes:
UOdinActivityEffect,UOdinCloneEffect,UOdinMuteEffect,UOdinRestGSTTEffect,UOdinRmsEffect,UOdinVolumeEffect - Blueprint: Blueprint type, Blueprintable, Abstract · Blueprint reference
The audio pipeline execution context is started on a pop call, not push.
e.g: encoder/decoder odin_encoder_push -> BLOCKING(encoder audio pipeline/effects -> odin_encoder_pop)
Not affected is, including, but not limited to, IO and Event library threads
Writing your own effect
Derive from UOdinCustomEffect and override CustomEffect. The pipeline calls it on the thread that pops the audio, not on the game thread: keep it fast, and dispatch anything else (UI, gameplay) to the game thread. Samples are 32-bit float, interleaved if the encoder or decoder is stereo. Set *bIsSilent to true to mark the buffer as silent for the following effects.
Insert the effect into a pipeline with UOdinPipeline::InsertCustomEffect:
Overview
Functions
| Name | Description |
|---|---|
CustomEffect | Custom Effect callbacks with buffer or do nothing if is silent-data. |
GetParent | |
SetParent | |
RemoveSelfFromParent | Removes the effect from the pipeline it was inserted into. |
Properties
| Name | Description |
|---|---|
Index | Index of the effect in its pipeline. |
EffectId | ID of the effect in its pipeline. |
Functions
CustomEffect
Virtual · Const
Custom Effect callbacks with buffer or do nothing if is silent-data. Override for a more useful implementation. *Care thread usage or dispatch to another!
| Parameter | Type | Description |
|---|---|---|
InSamples | const TArrayView<float>& | raw f32 sample buffer |
bIsSilent | bool*& | flag if sample buffer is considered silent |
InUserData | TOdinCustomEffectUserData<UOdinCustomEffect>* const | sending effect object (UOdinCustomEffect *) |
GetParent
Const · Inline
Returns TWeakObjectPtr<UOdinPipeline>
SetParent
Inline
| Parameter | Type | Description |
|---|---|---|
InPipeline | TWeakObjectPtr<UOdinPipeline> |
RemoveSelfFromParent
Blueprint: Detach Effect
Removes the effect from the pipeline it was inserted into.
Returns bool – True if the effect was removed.
Properties
Index
Blueprint: Get
Index of the effect in its pipeline.
EffectId
Blueprint: Get
ID of the effect in its pipeline.