VJ Master 1.0
Real-time audio analysis and visualisation.
Loading...
Searching...
No Matches
UST_AudioSoundWaveProcedural Class Reference

A procedural sound wave that allows streaming raw audio data at runtime. More...

#include <ST_AudioSoundWaveProcedural.h>

Public Member Functions

 UST_AudioSoundWaveProcedural (const FObjectInitializer &ObjectInitializer)
 Constructor for initializing the procedural sound wave.
 ~UST_AudioSoundWaveProcedural ()
 Destructor for cleanup.
virtual TUniquePtr< Audio::IProxyData > CreateNewProxyData (const Audio::FProxyDataInitParams &InitParams) override
 Creates a new proxy data object for this sound wave.
virtual int32 OnGeneratePCMAudio (TArray< uint8 > &OutAudio, int32 NumSamples)
 Called by the audio engine to generate raw PCM audio data.
void QueueAudioBuffer (const uint8 *AudioData, const int32 BufferSize)
 Queues raw PCM audio data for playback.
void Initialise (FFFTIOData FFTIOData, bool bUsedByMixerOnly, EST_SampleFormat NewSampleFormat)
 Setups up sound wave with relevant IO data.
virtual Audio::EAudioMixerStreamDataFormat::Type GetGeneratedPCMDataFormat () const override
 Return the format of the generated PCM data type.
virtual bool RegisterToIO (EAudioIOType NewAudioIOType)
virtual void DeregisterFromIO (EAudioIOType CurrAudioIOType)
virtual void OnAudioIOStatusChanged_Implementation (bool bIsActive, FIntPoint IOId) override
const FThreadSafeBool & GetInitialisedFlag () const
Public Member Functions inherited from IST_AudioProcessingInterface
void OnAudioIOStatusChanged (bool bIsActive, FIntPoint IOId)
 Event triggered when the status of an audio I/O device changes.
void OnRawMagnitudesReady (const TArray< float > &RawMagnitudes, FIntPoint IOId)
 Event triggered when raw magnitude data is ready for an audio I/O device.
void OnFrequencyBandsReady (const TArray< float > &FrequencyBands, int32 NumFrequencyBands, FIntPoint IOId)
 Event triggered when frequency band data is ready for an audio I/O device.
void OnAmplitudesReady (const TArray< float > &Amplitudes, FIntPoint IOId)
 Event triggered when amplitude data is ready for an audio I/O device.
void OnPitchesReady (const TArray< float > &Pitches, FIntPoint IOId)
 Event triggered when pitch data is ready for an audio I/O device.
void OnBeatDetected (const TArray< float > &Beats, const TArray< bool > &BeatDetectedForChannel, FIntPoint IOId)
 Event triggered when a beat is detected in the audio data for an I/O device.

Public Attributes

EAudioIOType Registered_AudioIOType = EAudioIOType::None

Detailed Description

A procedural sound wave that allows streaming raw audio data at runtime.

UST_AudioSoundWaveProcedural enables the feeding of audio samples dynamically via QueueAudioBuffer.

Constructor & Destructor Documentation

◆ UST_AudioSoundWaveProcedural()

UST_AudioSoundWaveProcedural::UST_AudioSoundWaveProcedural ( const FObjectInitializer & ObjectInitializer)

Constructor for initializing the procedural sound wave.

Parameters
ObjectInitializerThe initializer used to construct this object.

Member Function Documentation

◆ CreateNewProxyData()

TUniquePtr< Audio::IProxyData > UST_AudioSoundWaveProcedural::CreateNewProxyData ( const Audio::FProxyDataInitParams & InitParams)
overridevirtual

Creates a new proxy data object for this sound wave.

Used by the audio engine for optimized audio rendering and playback.

Parameters
InitParamsParameters used to initialize the proxy data.
Returns
A unique pointer to the created IProxyData instance.

◆ DeregisterFromIO()

void UST_AudioSoundWaveProcedural::DeregisterFromIO ( EAudioIOType CurrAudioIOType)
virtual

Deregisters the actor from an audio input/output type.

◆ GetGeneratedPCMDataFormat()

Audio::EAudioMixerStreamDataFormat::Type UST_AudioSoundWaveProcedural::GetGeneratedPCMDataFormat ( ) const
overridevirtual

Return the format of the generated PCM data type.

Used in audio mixer to allow generating float buffers and avoid unnecessary format conversions. This feature is only supported in audio mixer. If your procedural sound wave needs to be used in both audio mixer and old audio engine, it's best to generate int16 data as old audio engine only supports int16 formats. Or check at runtime if the audio mixer is enabled. Audio mixer will convert from int16 to float internally.

◆ Initialise()

void UST_AudioSoundWaveProcedural::Initialise ( FFFTIOData FFTIOData,
bool bUsedByMixerOnly,
EST_SampleFormat NewSampleFormat )

Setups up sound wave with relevant IO data.

Extracts FFTIOData from the Audio IO and sets channel and samples data. This should be called before sampler registration.

Parameters
FFFTIODataFFTIOData from the ST Audio IO.
bUsedByMixerOnlywhen true means it used by mixer only and the PCM Data can support float formats. When false we only support int16 formats.
NewSampleFormatis the format used by the IO device.

◆ OnAudioIOStatusChanged_Implementation()

void UST_AudioSoundWaveProcedural::OnAudioIOStatusChanged_Implementation ( bool bIsActive,
FIntPoint IOId )
overridevirtual

Called when the audio I/O status changes.

Parameters
bIsActiveIndicates if the audio I/O is active.
IOIdThe identifier of the I/O operation whose status has changed.

◆ OnGeneratePCMAudio()

int32 UST_AudioSoundWaveProcedural::OnGeneratePCMAudio ( TArray< uint8 > & OutAudio,
int32 NumSamples )
virtual

Called by the audio engine to generate raw PCM audio data.

Override this to provide audio samples to the playback engine.

Parameters
OutAudioThe array to fill with PCM audio data (int16).
NumSamplesThe number of samples requested by the engine.
Returns
The number of bytes actually written to OutAudio.

◆ QueueAudioBuffer()

void UST_AudioSoundWaveProcedural::QueueAudioBuffer ( const uint8 * AudioData,
const int32 BufferSize )

Queues raw PCM audio data for playback.

Accepts 16-bit signed PCM data (interleaved for stereo) and appends it to the internal buffer. This should be called continuously with new audio data during playback.

Parameters
AudioDataPointer to the PCM data buffer (must be in int16 format).
BufferSizeSize of the buffer in bytes.

◆ RegisterToIO()

bool UST_AudioSoundWaveProcedural::RegisterToIO ( EAudioIOType NewAudioIOType)
virtual

Registers the actor to an audio input/output type.

Member Data Documentation

◆ Registered_AudioIOType

EAudioIOType UST_AudioSoundWaveProcedural::Registered_AudioIOType = EAudioIOType::None

Registered audio input/output types for the visualisation actor.


The documentation for this class was generated from the following files:
  • H:/Games/Unreal/Aaron/FunWithShaders/Plugins/ST_VJMaster/Source/ST_AudioProcessing/Public/Sound/ST_AudioSoundWaveProcedural.h
  • H:/Games/Unreal/Aaron/FunWithShaders/Plugins/ST_VJMaster/Source/ST_AudioProcessing/Private/Sound/ST_AudioSoundWaveProcedural.cpp