FOdinSoundGenerator
FOdinSoundGenerator
An implementation of ISoundGenerator that pulls audio data from an Odin decoder and provides it to the Unreal Audio Engine.
- Header:
#include "OdinAudio/OdinSoundGenerator.h" - Module:
Odin - Inherits from:
ISoundGenerator
Overview
Functions
| Name | Description |
|---|---|
ResetConnectedDecoder | |
SetOdinDecoder | Sets the Odin decoder instance used to fetch audio data. |
Close | Closes the generator and stops audio processing. |
AddAudioBufferListener | Adds a listener that will receive the raw audio buffers generated by this instance. |
RemoveAudioBufferListener | Removes a previously added audio buffer listener. |
GetDesiredNumSamplesToRenderPerCallback | Returns the number of samples the generator prefers to render per callback. |
OnBeginGenerate | Called on audio generator thread right when the generator begins generating. |
OnGenerateAudio | Called when a new buffer is required by the audio engine. |
OnEndGenerate | Called on audio generator thread right when the generator ends generating. |
IsFinished | Checks if the sound generator has finished its playback. |
Constructors
Functions
ResetConnectedDecoder
SetOdinDecoder
Sets the Odin decoder instance used to fetch audio data.
| Parameter | Type | Description |
|---|---|---|
InDecoder | UOdinDecoder* | The UOdinDecoder to pull audio from. |
Close
Closes the generator and stops audio processing.
AddAudioBufferListener
Adds a listener that will receive the raw audio buffers generated by this instance.
| Parameter | Type | Description |
|---|---|---|
InAudioBufferListener | const TWeakPtr<IAudioBufferListener>& | A weak pointer to the listener interface. |
RemoveAudioBufferListener
Removes a previously added audio buffer listener.
| Parameter | Type | Description |
|---|---|---|
InAudioBufferListener | const TWeakPtr<IAudioBufferListener>& | A weak pointer to the listener to remove. |
GetDesiredNumSamplesToRenderPerCallback
Virtual · Const · Override
Returns the number of samples the generator prefers to render per callback.
Returns int32 – The preferred number of samples.
OnBeginGenerate
Virtual · Override
Called on audio generator thread right when the generator begins generating.
OnGenerateAudio
Virtual · Override
Called when a new buffer is required by the audio engine.
| Parameter | Type | Description |
|---|---|---|
OutAudio | float* | The buffer to fill with audio data. |
NumSamples | int32 | The number of samples requested. |
Returns int32 – The number of samples actually generated.
OnEndGenerate
Virtual · Override
Called on audio generator thread right when the generator ends generating.
IsFinished
Virtual · Const · Override
Checks if the sound generator has finished its playback.
Returns bool – True if finished, false otherwise.