Class UAudioAnalyzerManager

Inheritance Relationships

Base Type

  • public UObject

Class Documentation

class UAudioAnalyzerManager : public UObject

Audio Analyzer Manager.

Audio Analyzer blueprint interface

Player Events

FInitAudioDelegate OnInitPlayerAudioFinished

Event to track the async player initialization end

FPlaybackDelegate OnPlaybackFinished

Event to track the player playback end

FPlaybackDelegate OnPlaybackLoopFinished

Event to track the player loop playback end

Capture Events

FCaptureDelegate OnCapturedData

Event to track the player playback end

Loopback Events

FCaptureDelegate OnLoopbackCapturedData

Event to track the player playback end

Extractor Events

FInitAudioDelegate OnInitExtractorAudioFinished

Event to track the async extractor initialization end

FConstructSoundWaveDelegate OnConstructSoundWaveFinished

Event to track the async construct soundwave end

AudioComponent Events

FPlaybackDelegate OnAudioComponentPlaybackFinished

Event to track the audio component playback end

FPlaybackDelegate OnAudioComponentPlaybackLoopFinished

Event to track the audio component loop playback end

FPlaybackDelegate OnAudioComponentStopFinished

Event to track the audio component stop playback

Player Initialization

bool InitPlayerAudio(const FString &FileName)

Initializes the player audio source instance

Parameters:

FileName – Path to the audio file

Returns:

Initialization result

bool InitPlayerAudioEx(const FString &FileName, int32 PeriodSizeInFrames = 0, int32 PeriodSizeInMilliseconds = 0, int32 Periods = 0)

Initializes the player audio source instance (Extended version)

Parameters:
  • FileName – Path to the audio file

  • PeriodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • PeriodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • Periods – Device audio buffer size multiplier, 0 to use default value

Returns:

Initialization result

bool AsyncInitPlayerAudio(const FString &FileName, int32 PeriodSizeInFrames = 0, int32 PeriodSizeInMilliseconds = 0, int32 Periods = 0)

Initializes the player audio source instance (Async version)

Parameters:
  • FileName – Path to the audio file

  • PeriodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • PeriodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • Periods – Device audio buffer size multiplier, 0 to use default value

Returns:

Async Player initialization has been scheduled

bool IsAsyncInitPlayerAudioRunning() const

Check if there is an async player initialization running

Returns:

bool An async player initialization is running

void UnloadPlayerAudio()

Closes the player audio device

void SetDefaultDevicePlayerAudio(const FString &AudioDeviceName)

Sets default player device

Parameters:

AudioDeviceName – Name of audio device (GetOutputAudioDeviceNames output)

void GetDefaultDevicePlayerAudio(FString &PlayerDeviceName)

Returns the default player device name (use after InitPlayerAudio)

Parameters:

PlayerDeviceName[out] Name of audio device

Capturer Initialization

bool InitCapturerAudio()

Initializes the capturer audio source instance

Returns:

Initialization result

bool InitCapturerAudioEx(int32 SampleRate = 44100, EAA_AudioDepth BitDepth = EAA_AudioDepth::B_16, EAA_AudioFormat AudioFormat = EAA_AudioFormat::Signed_Int, float AudioBufferSeconds = 1.f, bool InitPlaybackDevice = false, int32 PeriodSizeInFrames = 0, int32 PeriodSizeInMilliseconds = 0, int32 Periods = 0)

Initializes the capturer audio source instance (Extended version)

Parameters:
  • SampleRate – Samples per second of the capture

  • BitDepth – Bits per sample

  • AudioFormat – Sample number format

  • AudioBufferSeconds – Number of seconds of capture history

  • InitPlaybackDevice – Initializes a playback device

  • PeriodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • PeriodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • Periods – Device audio buffer size multiplier, 0 to use default value

Returns:

Initialization result

void UnloadCapturerAudio()

Closes the capturer audio device

void SetDefaultDevicesCapturerAudio(const FString &CapturerDeviceName, const FString &PlayerDeviceName)

Sets default capturer devices

Parameters:
  • CapturerDeviceName – Name of audio capturer device (GetInputAudioDeviceNames output)

  • PlayerDeviceName – Name of audio player device (GetOutputAudioDeviceNames output)

void GetDefaultDevicesCapturerAudio(FString &CapturerDeviceName, FString &PlayerDeviceName)

Returns the default capturer device names (use after InitCapturerAudio)

Parameters:
  • CapturerDeviceName[out] Name of audio captuter device

  • PlayerDeviceName[out] Name of audio player device

Loopback Initialization

bool InitLoopbackAudio()

Initializes the loopback audio source instance

Returns:

Initialization result

bool InitLoopbackAudioEx(int32 NumChannels = 2, int32 SampleRate = 44100, EAA_AudioDepth BitDepth = EAA_AudioDepth::B_16, EAA_AudioFormat AudioFormat = EAA_AudioFormat::Signed_Int, float AudioBufferSeconds = 1.f, int32 PeriodSizeInFrames = 0, int32 PeriodSizeInMilliseconds = 0, int32 Periods = 0)

Initializes the loopback audio source instance (Extended version)

Parameters:
  • NumChannels – Number of channels

  • SampleRate – Samples per second

  • BitDepth – Bits per sample

  • AudioFormat – Sample number format

  • AudioBufferSeconds – Number of seconds of capture history

  • PeriodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • PeriodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • Periods – Device audio buffer size multiplier, 0 to use default value

Returns:

Initialization result

void UnloadLoopbackAudio()

Closes the capturer audio device

void SetDefaultDeviceLoopbackAudio(const FString &SourceDeviceName)

Sets default loopback devices

Parameters:

SourceDeviceName – Friendly Name of audio source device (GetOutputAudioDeviceNames output)

void GetDefaultDeviceLoopbackAudio(FString &SourceDeviceName)

Returns the default loopback device names (use after InitLoopbackAudio)

Parameters:

SourceDeviceName[out] Friendly Name of audio source device

Stream Initialization

bool InitStreamAudio(int32 NumChannels = 2, int32 SampleRate = 44100, EAA_AudioDepth BitDepth = EAA_AudioDepth::B_16, EAA_AudioFormat AudioFormat = EAA_AudioFormat::Signed_Int, float AudioBufferSeconds = 1.0f, bool InitPlaybackDevice = false, int32 PeriodSizeInFrames = 0, int32 PeriodSizeInMilliseconds = 0, int32 Periods = 0)

Initializes the stream audio source instance

Parameters:
  • NumChannels – Number of channels

  • SampleRate – Samples per second

  • BitDepth – Bits per sample

  • AudioFormat – Sample number format

  • AudioBufferSeconds – Number of seconds of capture history

  • InitPlaybackDevice – Initialize device to playback received data

  • PeriodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • PeriodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • Periods – Device audio buffer size multiplier, 0 to use default value

Returns:

Initialization result

void UnloadStreamAudio()

Closes the stream listener audio device

void SetDefaultDeviceStreamAudio(const FString &PlayerDeviceName)

Sets default stream playback device.

Parameters:

PlayerDeviceName – Friendly Name of audio source device (GetOutputAudioDeviceNames output)

void GetDefaultDeviceStreamAudio(FString &PlayerDeviceName)

Returns the default stream playback device names (use after InitLoopbackAudio)

Parameters:

PlayerDeviceName[out] Friendly Name of audio source device

Extractor Initialization <br>

bool InitExtractorAudio(const FString &FileName, bool OnlyHeader)

Initializes the extractor audio source instance

Parameters:
  • FileName – Path to the audio file

  • OnlyHeader – Load only header info, audio data will not be uncompressed

Returns:

Initialization result

bool AsyncInitExtractorAudio(const FString &FileName, bool OnlyHeader)

Initializes the extractor audio source instance

Parameters:
  • FileName – Path to the audio file

  • OnlyHeader – Load only header info, audio data will not be uncompressed

Returns:

Async extrator initialization scheduled

bool IsAsyncInitExtractorAudioRunning() const

Check if there is an async extractor initialization running

Returns:

bool An async extractor initialization is running

bool ConstructSoundWave(UAudioAnalyzerSoundWave *&SoundWave, const FString &FileName)

Construct a SoundWave object for the audio file at runtime

Parameters:
  • SoundWave[out] SoundWave object

  • FileName – Path to the audio file

Returns:

Initialization result

bool AsyncConstructSoundWave(const FString &FileName)

Construct a SoundWave object for the audio file at runtime. Use

Parameters:

FileName – Path to the audio file

Returns:

Initialization scheduled

bool IsAsyncConstructSoundWaveRunning() const

Check if there is an async construct SoundWave running

Returns:

bool An async construct SoundWave is running

void GetSoundWave(UAudioAnalyzerSoundWave *&SoundWave) const

Get previuos constructed SoundWave object

Parameters:

SoundWave[out] SoundWave object

void UnloadExtractorAudio()

Closes the extractor audio source

void UnloadSoundWave()

Closes the extractor audio source and free the SoundWave object

OVR Initialization <br>

bool InitOVRAudio(int32 SampleRate = 48000, EAA_AudioFormat AudioFormat = EAA_AudioFormat::Signed_Int, float AudioBufferSeconds = 1.f, bool InitPlaybackDevice = false, int32 PeriodSizeInFrames = 0, int32 PeriodSizeInMilliseconds = 0, int32 Periods = 0)

Initializes the OVR audio source instance

Parameters:
  • SampleRate – Samples per second of the capture

  • AudioFormat – Sample format (Float/Fixed)

  • AudioBufferSeconds – Number of seconds of capture history

  • InitPlaybackDevice – Initialize device to playback received data

  • PeriodSizeInFrames – Device audio buffer size in frames (power of 2), 0 to use default value

  • PeriodSizeInMilliseconds – Device audio buffer size in milliseconds, 0 to use default value

  • Periods – Device audio buffer size multiplier, 0 to use default value

Returns:

Initialization result

void UnloadOVRAudio()

Closes the OVR audio source

void SetDefaultDevicesOVRAudio(const FString &CapturerDeviceName, const FString &PlayerDeviceName)

Sets default OVR devices

Parameters:
  • CapturerDeviceName – Name of audio capturer device (GetInputAudioDeviceNames output)

  • PlayerDeviceName – Name of audio player device (GetOutputAudioDeviceNames output)

void GetDefaultDevicesOVRAudio(FString &CapturerDeviceName, FString &PlayerDeviceName)

Returns the default OVR device names (use after InitOVRAudio)

Parameters:
  • CapturerDeviceName[out] Name of audio captuter device

  • PlayerDeviceName[out] Name of audio player device

Audio Component Initialization <br>

void LinkAudioComponent(UAudioComponent *AudioComponent)

Add an Audio Component pointer to the audio manager

Parameters:

AudioComponent – Path to the audio file

void UnlinkAudioComponent()

Removes the pointer of the Audio Component of the audio manager

Player Playback

void Play()

Starts player playback, 1 loop from 0.0 seconds

void PlayEx(int32 Loops = 1, float StartTime = 0.f)

Starts player playback, n loops from StartTime seconds

Parameters:
  • Loops – Number of loops, (0 Infinite)

  • StartTime – Starting position in seconds

void Stop()

Stops player playback

void Pause()

Pauses player playback if the device is in playing state UnPauses player playback if the device has been paused previously

void SetPaused(bool Pause)

Sets the player state on pause/unpause state

Parameters:

Pause – New pause state

float GetPlaybackTime()

Returns current player playback position

Returns:

Playback position

void SetPlaybackTime(float Progress)

Sets current player playback position

Parameters:

Progress – New playback position in seconds

float GetPlaybackVolume()

Returns current player playback volume

Returns:

Playback volume

void SetPlaybackVolume(float Volume = 1.f)

Sets a new volume in range 0.0 - 1.0

Parameters:

Volume – New volume in range 0.0 - 1.0

float GetTotalDuration() const

Returns total player playback duration

Returns:

Playback duration

bool IsPlaying() const

Returns player playing state

Returns:

Player is playing

bool IsPaused() const

Returns player pause state

Returns:

Player is paused

int32 GetRemainingLoops() const

Returns remaining loops to play

Returns:

remaining loops

Capturer Playback

void StartCapture(bool PlaybackCapture = false, bool CapturedDataBroadcast = false)

Starts audio capture (and playback)

Parameters:
  • PlaybackCapture – Starts playback too

  • CapturedDataBroadcast – Returns the captured audio buffer using OnCapturedData Event

void StopCapture()

Stops audio capture

bool IsCapturing() const

Returns capture state

Returns:

Source is capturing audio

float GetCaptureTime()

Returns current total capture time

Returns:

Elapsed capture time

void GetCaptureVolume(float &CaptureVolume, float &PlaybackVolume)

Returns current capture volume

Parameters:
  • CaptureVolume[out] Current capture volume

  • PlaybackVolume[out] Playback capture volume

void SetCaptureVolume(float CaptureVolume = 1.f, float PlaybackVolume = 1.f)

Sets a new volume for microphone capture and playback in range 0.0 - 1.0

Parameters:
  • CaptureVolume – New capture volume in range 0.0 - 1.0

  • PlaybackVolume – New playback volume in range 0.0 - 1.0

Loopback Playback

void StartLoopback(bool CapturedDataBroadcast)

Starts audio loopback capture

Parameters:

CapturedDataBroadcast – Returns the captured audio buffer using OnLoopbackCapturedData event

void StopLoopback()

Stops audio loopback capture

bool IsLoopbackCapturing() const

Returns player playing state

Returns:

Player is playing

float GetLoopbackCaptureTime()

Returns current loopback total capture time

Returns:

Elapsed capture time

Extractor Playback

float GetAudioTotalDuration() const

Returns total audio duration

Returns:

Audio duration

Stream Playback

void OpenStreamCapture(bool PlaybackCapture)

Opens audio loopback capture (and starts playback)

Parameters:

PlaybackCapture – Enables the playback of the stream audio pcm data

void FeedStreamCapture(TArray<uint8> StreamData)

Sends the stream audio data to the analyzer

Parameters:

StreamData – Stream data array

void CloseStreamCapture()

Closes audio loopback capture and stops the playback

bool IsStreamCapturing() const

Returns player playing state

Returns:

Player is playing

float GetStreamCaptureTime()

Returns current loopback total capture time

Returns:

Elapsed capture time

OVR Capture

void StartOVRCapture(bool PlaybackCapturer)

Starts OVR audio capture (and playback)

Parameters:

PlaybackCapturer – Starts playback too

void StopOVRCapture()

Stops OVR audio capture

bool IsOVRCapturing() const

Returns OVR Capture state

Returns:

OVR is capturing audio

float GetOVRCaptureTime()

Returns total OVR capture time

Returns:

Elapsed OVR capture time

Audio Component wrapper

void PlayAudioComponent(int32 Loops = 1, float StartTime = 0.f)

Starts Audio component playback, n loops from StartTime seconds

Parameters:
  • Loops – Number of loops, (0 Infinite)

  • StartTime – Starting position in seconds

void StopAudioComponent()

Stops Audio component playback

void AsyncStopAudioComponent()

Stops Audio component playback, the event OnAudioComponentStopFinished will be triggered after stop process is done

void PauseAudioComponent()

Pauses audio component playback if the device is in playing state UnPauses audio component playback if the device has been paused previously

void SetPausedAudioComponent(bool Pause)

Sets the audio component state on pause/unpause state

Parameters:

Pause – New pause state

void SetAudioComponentPlaybackTime(float Progress)

Sets current audio component playback position

Parameters:

Progress – New playback position in seconds

float GetAudioComponentPlaybackTime()

Returns current audio component playback position

Returns:

Playback position

float GetAudioComponentTotalDuration() const

Returns total audio component playback duration

Returns:

Playback duration

bool IsAudioComponentPlaying() const

Returns audio component playing state

Returns:

Audio component is playing

bool IsAudioComponentPaused() const

Returns audio component pause state

Returns:

Audio component is paused

int32 GetAudioComponentRemainingLoops() const

Returns remaining loops to play

Returns:

remaining loops

UAudioComponent *GetLinkedAudioComponent() const

Returns a pointer to the linked audio component

Returns:

Pointer to Audio Component

Player Utils

void GetMetadata(FString &Filename, FString &Extension, FString &MetaType, FString &Title, FString &Artist, FString &Album, FString &Year, FString &Genre)

Retrieves metadata info

Parameters:
  • Filename[out] Filename of the audio file

  • Extension[out] Extension of the audio file

  • MetaType[out] ID3_V1 | ID3_V2.3 | ID3_V2.4

  • Title[out] Title of the song

  • Artist[out] Artist

  • Album[out] Album

  • Year[out] Year

  • Genre[out] Genre

void GetMetadataArt(const FString &Prefix, const FString &Folder, int32 &NumberOfPictures)

Extract the AlbumArt pictures into the selected folder. Prefix1.png, Prefix2.png,…

Parameters:
  • Prefix – Prefix used to name the pictures.

  • Folder – Destination folder, must exists

  • NumberOfPictures[out] Number of stored pictures

void GetPlayerDeviceAudioInfo(FString &DeviceName, int32 &SampleRate, int32 &NumChannels, int32 &BufferSamples, EAA_AudioFormat &Format, int32 &BitDepth)

Returns the parameters used to configure the player device

Parameters:
  • DeviceName[out] Name of the device in the system devices list

  • SampleRate[out] Number of samples per second

  • NumChannels[out] Number of channels

  • BufferSamples[out] Number of samples of the playback buffer

  • Format[out] Format of the values that represent each sample (Fixed/Float)

  • BitDepth[out] Number of bits used for each sample

Capturer Utils

void GetCapturerDevicesAudioInfo(FString &CapturerDeviceName, int32 &CapturerSampleRate, int32 &CapturerNumChannels, int32 &CapturerBufferSamples, EAA_AudioFormat &CapturerFormat, int32 &CapturerBitDepth, FString &PlayerDeviceName, int32 &PlayerSampleRate, int32 &PlayerNumChannels, int32 &PlayerBufferSamples, EAA_AudioFormat &PlayerFormat, int32 &PlayerBitDepth)

Retrieves the capture/playback audio device info

Parameters:
  • CapturerDeviceName[out] Name of the capturer device in the system devices list

  • CapturerSampleRate[out] Number of samples per second

  • CapturerNumChannels[out] Number of channels

  • CapturerBufferSamples[out] Number of samples of the playback buffer

  • CapturerFormat[out] Format of the values that represent each sample (Fixed/Float)

  • CapturerBitDepth[out] Number of bits used for each sample

  • PlayerDeviceName[out] Name of the player device in the system devices list

  • PlayerSampleRate[out] Number of samples per second

  • PlayerNumChannels[out] Number of channels

  • PlayerBufferSamples[out] Number of samples of the playback buffer

  • PlayerFormat[out] Format of the values that represent each sample (Fixed/Float)

  • PlayerBitDepth[out] Number of bits used for each sample

Loopback Utils

void GetLoopbackDeviceAudioInfo(FString &DeviceName, int32 &SampleRate, int32 &NumChannels, int32 &BufferSamples, EAA_AudioFormat &Format, int32 &BitDepth)

Retrieves audio device info

Parameters:
  • DeviceName[out] Name of the device in the system devices list

  • SampleRate[out] Number of samples per second

  • NumChannels[out] Number of channels

  • BufferSamples[out] Number of samples of the playback buffer

  • Format[out] Format of the values that represent each sample (Fixed/Float)

  • BitDepth[out] Number of bits used for each sample

Extractor Utils

void GetAudioMetadata(FString &Filename, FString &Extension, FString &MetaType, FString &Title, FString &Artist, FString &Album, FString &Year, FString &Genre)

Retrieves metadata info for Extractor Source Object

Parameters:
  • Filename[out] Filename of the audio file

  • Extension[out] Extension of the audio file

  • MetaType[out] ID3_V1 | ID3_V2.3 | ID3_V2.4

  • Title[out] Title of the song

  • Artist[out] Artist

  • Album[out] Album

  • Year[out] Year

  • Genre[out] Genre

void GetAudioMetadataArt(const FString &Prefix, const FString &Folder, int32 &NumberOfPictures)

Extract the AlbumArt pictures into the selected folder.Prefix1.png, Prefix2.png, …

Parameters:
  • Prefix – Prefix used to name the pictures.

  • Folder – Destination folder, must exists

  • NumberOfPictures[out] Number of stored pictures

Stream Utils

void GetStreamDevicesAudioInfo(FString &PlayerDeviceName, int32 &PlayerSampleRate, int32 &PlayerNumChannels, int32 &PlayerBufferSamples, EAA_AudioFormat &PlayerFormat, int32 &PlayerBitDepth)

Retrieves the stream playback audio device info

Parameters:
  • PlayerDeviceName[out] Name of the device in the system devices list

  • PlayerSampleRate[out] Number of samples per second

  • PlayerNumChannels[out] Number of channels

  • PlayerBufferSamples[out] Number of samples of the playback buffer

  • PlayerFormat[out] Format of the values that represent each sample (Fixed/Float)

  • PlayerBitDepth[out] Number of bits used for each sample

OVR Utils

void GetOVRDevicesAudioInfo(FString &CapturerDeviceName, int32 &CapturerSampleRate, int32 &CapturerNumChannels, int32 &CapturerBufferSamples, EAA_AudioFormat &CapturerFormat, int32 &CapturerBitDepth, FString &PlayerDeviceName, int32 &PlayerSampleRate, int32 &PlayerNumChannels, int32 &PlayerBufferSamples, EAA_AudioFormat &PlayerFormat, int32 &PlayerBitDepth)

Retrieves the audio device info

Parameters:
  • CapturerDeviceName[out] Name of the capturer device in the system devices list

  • CapturerSampleRate[out] Number of samples per second

  • CapturerNumChannels[out] Number of channels

  • CapturerBufferSamples[out] Number of samples of the playback buffer

  • CapturerFormat[out] Format of the values that represent each sample (Fixed/Float)

  • CapturerBitDepth[out] Number of bits used for each sample

  • PlayerDeviceName[out] Name of the player device in the system devices list

  • PlayerSampleRate[out] Number of samples per second

  • PlayerNumChannels[out] Number of channels

  • PlayerBufferSamples[out] Number of samples of the playback buffer

  • PlayerFormat[out] Format of the values that represent each sample (Fixed/Float)

  • PlayerBitDepth[out] Number of bits used for each sample

Analysis Initialization

void InitAmplitudeConfig(EAA_ChannelSelectionMode ChannelMode, int32 Channel, int32 NumTimeBands = 1, float TimeWindow = 0.02f)

Initializes the amplitude analyzer for a window of time (seconds) centered on current playback position and group it into bars /

Parameters:
  • ChannelMode – Channel selection mode

  • Channel – Number of channel (only for Select_one channel selection mode)

  • NumTimeBands – Number of bars

  • TimeWindow – The duration of the window to calculate the amplitude

void InitSpectrumConfig(EAA_SpectrumType Type, EAA_ChannelSelectionMode ChannelMode, int32 Channel, int32 NumFreqBands = 1, float TimeWindow = 0.02f, int32 HistorySize = 30, bool UsePeakValues = true, int32 NumPeaks = 1)

Initializes the frequency spectrum analyzer for a window of time

Parameters:
  • Type – Select the display spectrum format Linear/Log

  • ChannelMode – Channel selection mode

  • Channel – The channel of the sound to calculate (only for Select_one channel selection mode)

  • NumFreqBands – Number of bands of spectrum

  • TimeWindow – The duration of the window to calculate the spectrum of

  • HistorySize – History size to calculate average frequency spectrum

  • UsePeakValues – Returns peak value of the band instead of average value

  • NumPeaks – Number of peaks for GetSpectrumPeaks output

void InitSpectrumConfigWLimits(EAA_ChannelSelectionMode ChannelMode, int32 Channel, const TArray<FVector2D> &BandLimits, float TimeWindow = 0.02f, int32 HistorySize = 30, bool UsePeakValues = true, int32 NumPeaks = 1)

Initializes the frequency spectrum analyzer for a window of time

Parameters:
  • ChannelMode – Channel selection mode

  • Channel – The channel of the sound to calculate (only for Select one channel selection mode)

  • BandLimits – Array to define the frequency bounds for each spectrum bar (no overlap)

  • TimeWindow – The duration of the window to calculate the spectrum of

  • HistorySize – History size to calculate average frequency spectrum

  • UsePeakValues – Returns peak value of the band instead of average value

  • NumPeaks – Number of peaks for GetSpectrumPeaks output

void InitBeatTrackingConfig(EAA_ChannelSelectionMode ChannelMode, int32 Channel, float TimeWindow = 0.02f, int32 HistorySize = 30, bool CalculateBPM = false, int32 BPMHistorySize = 100, float Threshold = 2.1)

Initializes the beat tracking analyzer for a window of time

Parameters:
  • ChannelMode – Channel selection mode

  • Channel – The channel of the sound to calculate (only for Select one channel mode)

  • TimeWindow – The duration of the window to calculate the beat tracking

  • HistorySize – History size to calculate the average spectrum

  • CalculateBPM – Enable BPM calculator

  • BPMHistorySize – History size to calculate the average BPM

  • Threshold – Beat detection threshold

void InitBeatTrackingConfigWLimits(EAA_ChannelSelectionMode ChannelMode, int32 Channel, const TArray<FVector2D> &BandLimits, float TimeWindow = 0.02f, int32 HistorySize = 30, bool CalculateBPM = false, int32 BPMHistorySize = 100, float Threshold = 2.1)

Initializes the beat tracking analyzer for a window of time using custom frequency bounds

Parameters:
  • ChannelMode – Channel selection mode

  • Channel – The channel of the sound to calculate (only for Select_one channel mode)

  • BandLimits – Frequency bound for each beat tracking output (no overlap)

  • TimeWindow – The duration of the window to calculate the beat tracking

  • HistorySize – History size to calculate the average spectrum

  • CalculateBPM – Enable BPM calculator

  • BPMHistorySize – History size to calculate the average BPM

  • Threshold – Beat detection threshold

void InitPitchTrackingConfig(EAA_ChannelSelectionMode ChannelMode, int32 Channel, float TimeWindow = 0.08f, float Threshold = 0.19f)

Initializes the pitch tracking analyzer for a window of time

Parameters:
  • ChannelMode – Channel selection mode

  • Channel – Number of channel (only for Select_one channel selection mode)

  • TimeWindow – The duration of the window to calculate the amplitude

  • Threshold – YIN threshold

Analysis Results

void GetAmplitude(TArray<float> &Amplitude)

Returns amplitude using the amplitude configuration

Parameters:

Amplitude[out] Amplitude array result

void GetSpectrum(TArray<float> &Frequencies, TArray<float> &AverageFrequencies, bool CalculateAverageFrequencies)

Calculates the frequency spectrum using the spectrum configuration

Parameters:
  • Frequencies[out] The frequency spectrum result

  • AverageFrequencies[out] The average frequency spectrum result

  • CalculateAverageFrequencies – Calculate history spectrum average

void GetSpectrumPeaks(TArray<float> &FrequencyPeaks, TArray<float> &FrequencyPeaksEnergy)

Calculates the frequency spectrum peaks using the spectrum configuration

Parameters:
  • FrequencyPeaks[out] The frequency peaks result

  • FrequencyPeaksEnergy[out] The frequency peaks energy result

void GetBeatTracking(bool &IsBass, bool &IsLowM, bool &IsHighM, TArray<float> &SpectrumValues, TArray<int32> &BPMCurrent, TArray<int32> &BPMTotal)

Returns the default beat tracking result

Parameters:
  • IsBass[out] Beat result for bass frequency range

  • IsLowM[out] Beat result for low frequency mid range

  • IsHighM[out] Beat result for high frequency mid range

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

void GetBeatTrackingWThreshold(bool &IsBass, bool &IsLowM, bool &IsHighM, TArray<float> &SpectrumValues, TArray<int32> &BPMCurrent, TArray<int32> &BPMTotal, const TArray<float> &OverrideThreshold)

Returns the default beat tracking result

Parameters:
  • IsBass[out] Beat result for bass frequency range

  • IsLowM[out] Beat result for low frequency mid range

  • IsHighM[out] Beat result for high frequency mid range

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

  • OverrideThreshold – Overrides beat configuration threshold for each band

void GetBeatTrackingWLimits(TArray<bool> &Beats, TArray<float> &SpectrumValues, TArray<int32> &BPMCurrent, TArray<int32> &BPMTotal)

Returns the beat tracking result for the InitBeatTrackingConfigWLimits BandLimits

Parameters:
  • Beats[out] Beat result for BandLimits frequency ranges

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

void GetBeatTrackingWLimitsWThreshold(TArray<bool> &Beats, TArray<float> &SpectrumValues, TArray<int32> &BPMCurrent, TArray<int32> &BPMTotal, const TArray<float> &OverrideThreshold)

Returns the beat tracking result for the InitBeatTrackingConfigWLimits BandLimits

Parameters:
  • Beats[out] Beat result for BandLimits frequency ranges

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

  • OverrideThreshold – Overrides beat configuration threshold

void GetBeatTrackingAverage(TArray<float> &AverageFrequencies)

Returns the average frequency spectrum for the beat tracking history

Parameters:

AverageFrequencies[out] Average frequency spectrum result

void GetBeatTrackingAverageAndVariance(TArray<float> &AverageFrequencies, TArray<float> &VarianceFrequencies)

Returns the variance and average frequency spectrum for the beat tracking history

Parameters:
  • VarianceFrequencies[out] Variance frequency spectrum result

  • AverageFrequencies[out] Average frequency spectrum result

void GetPitchTracking(float &FundamentalFrequency)

Calculates and obtains the pitch tracking analysis result for the current spectrum

Parameters:

FundamentalFrequency[out] Fundamental frequency (F0), Pitch tracking must be enabled (InitSpectrumConfig)

Analysis Results By Channel

void GetAmplitudeByChannel(UChannelFResult *&AmplitudeByChannel)

Returns amplitude using the amplitude configuration. Only for channel selection mode Split_all

Parameters:

AmplitudeByChannel[out] Amplitude array result by channel

void GetSpectrumByChannel(UChannelFResult *&Frequencies, UChannelFResult *&AverageFrequencies, bool CalculateAverageFrequencies)

Calculates the frequency spectrum using the spectrum configuration. Only for channel selection mode Split_all

Parameters:
  • Frequencies[out] The frequency spectrum result for each channel

  • AverageFrequencies[out] The average frequency spectrum result for each channel

  • CalculateAverageFrequencies – Calculate history spectrum average

void GetSpectrumPeaksByChannel(UChannelFResult *&FrequencyPeaks, UChannelFResult *&FrequencyPeaksEnergy)

Calculates the frequency spectrum peaks using the spectrum configuration. Only for channel selection mode Split_all

Parameters:
  • FrequencyPeaks[out] The frequency peaks result for each channel

  • FrequencyPeaksEnergy[out] The frequency peaks energy result for each channel

void GetBeatTrackingByChannel(TArray<bool> &IsBass, TArray<bool> &IsLowM, TArray<bool> &IsHighM, UChannelFResult *&SpectrumValues, UChannelIResult *&BPMCurrent, UChannelIResult *&BPMTotal)

Returns the default beat tracking result. Only for channel selection mode Split_all

Parameters:
  • IsBass[out] Beat result for bass frequency range

  • IsLowM[out] Beat result for low frequency mid range

  • IsHighM[out] Beat result for high frequency mid range

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

void GetBeatTrackingWThresholdByChannel(TArray<bool> &IsBass, TArray<bool> &IsLowM, TArray<bool> &IsHighM, UChannelFResult *&SpectrumValues, UChannelIResult *&BPMCurrent, UChannelIResult *&BPMTotal, const TArray<float> &OverrideThreshold)

Returns the default beat tracking result. Only for channel selection mode Split_all

Parameters:
  • IsBass[out] Beat result for bass frequency range

  • IsLowM[out] Beat result for low frequency mid range

  • IsHighM[out] Beat result for high frequency mid range

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

  • OverrideThreshold – Overrides beat configuration threshold for each band

void GetBeatTrackingWLimitsByChannel(UChannelBResult *&Beats, UChannelFResult *&SpectrumValues, UChannelIResult *&BPMCurrent, UChannelIResult *&BPMTotal)

Returns the beat tracking result for the InitBeatTrackingConfigWLimits BandLimits. Only for channel selection mode Split_all

Parameters:
  • Beats[out] Beat result for BandLimits frequency ranges

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

void GetBeatTrackingWLimitsWThresholdByChannel(UChannelBResult *&Beats, UChannelFResult *&SpectrumValues, UChannelIResult *&BPMCurrent, UChannelIResult *&BPMTotal, const TArray<float> &OverrideThreshold)

Returns the beat tracking result for the InitBeatTrackingConfigWLimits BandLimits. Only for channel selection mode Split_all

Parameters:
  • Beats[out] Beat result for BandLimits frequency ranges

  • SpectrumValues[out] Current frequency spectrum values

  • BPMCurrent[out] Average BPM (Partial)

  • BPMTotal[out] Average BPM (Total)

  • OverrideThreshold – Overrides beat configuration threshold

void GetBeatTrackingAverageByChannel(UChannelFResult *&AverageFrequencies)

Returns the average frequency spectrum for the beat tracking history. Only for channel selection mode Split_all

Parameters:

AverageFrequencies[out] Average frequency spectrum result by channel

void GetBeatTrackingAverageAndVarianceByChannel(UChannelFResult *&AverageFrequencies, UChannelFResult *&VarianceFrequencies)

Returns the variance and average frequency spectrum for the beat tracking history. Only for channel selection mode Split_all

Parameters:
  • VarianceFrequencies[out] Variance frequency spectrum result by channel

  • AverageFrequencies[out] Average frequency spectrum result by channel

void GetPitchTrackingByChannel(UChannelFResult *&FundamentalFrequency)

Calculates and obtains the pitch tracking analysis result for the current spectrum. Only for channel selection mode Split_all

Parameters:

FundamentalFrequency[out] Fundamental frequency (F0), Pitch tracking must be enabled (InitSpectrumConfig)

Extractor Analysis results

void GetAmplitudeSection(TArray<float> &Amplitude, EAA_ChannelSelectionMode ChannelMode, int32 Channel, float StartTime, float EndTime, int Resolution = 1)

Returns amplitude result for an specific section analysis of the sound

Parameters:
  • Amplitude[out] Amplitude array result

  • ChannelMode – Channel selection mode

  • Channel – Number of channel (only for Select_one channel selection mode)

  • StartTime – Start position of the section (seconds)

  • EndTime – End position of the section (seconds)

  • Resolution – Number of samples by bar

void GetAmplitudeSectionByChannel(UChannelFResult *&Amplitude, float StartTime, float EndTime, int Resolution = 1)

Returns amplitude result for an specific section analysis of the sound

Parameters:
  • Amplitude[out] Amplitude array result by channels

  • StartTime – Start position of the section (seconds)

  • EndTime – End position of the section (seconds)

  • Resolution – Number of samples by bar

Utils

void GetOutputAudioDevices(TArray<FString> &AudioDeviceNames)

Returns a list with the output audio device friendly names

Parameters:

AudioDeviceNames[out] Audio device names

void GetInputAudioDevices(TArray<FString> &AudioDeviceNames)

Returns a list with the input audio device friendly names

Parameters:

AudioDeviceNames[out] Audio device names

static FString GetAndroidProjectFolder()

Returns installation android project folder path

Returns:

Project folder

static bool GetFolderFiles(const FString &FolderPath, const FString &Extension, TArray<FString> &FileNames)

Returns the names of files in the specified directory.

Parameters:
  • FolderPath – Directory path

  • Extension – Extension file filter

  • FileNames[out] List of files

Returns:

Operation result

static bool DeleteFolderFilesByExtension(const FString &FolderPath, const FString &Extension)

Delete all files from a folder that match the extension

Parameters:
  • FolderPath – Directory path

  • Extension – Extension file filter

Returns:

Operation result

static bool DeleteFolderFilesByFilename(const FString &FolderPath, const TArray<FString> &FileNames)

Delete all files from a folder that match the filenames list

Parameters:
  • FolderPath – Directory path

  • FileNames – List of files

Returns:

Operation result

static bool CreateDirectoryTree(const FString &FolderPath)

Create folder directory if not exists

Parameters:

FolderPath – Directory path

Returns:

Operation result, if already exists return false

static bool DeleteFolder(const FString &FolderPath, bool OnlyIfEmpty = true)

Delete folder if empty. Disabling OnlyIfEmpty will delete the folder recursively

Parameters:
  • FolderPath – Directory path

  • OnlyIfEmpty – Delete only if the directory is empty

Returns:

Operation result

static bool FolderExists(const FString &FolderPath)

Checks if folder exists

Parameters:

FolderPath – Directory path

Returns:

Operation result

static void FrequencyToMIDI(int32 &Note, int32 &Cents, const float &FrequencyHz)

Converts a frequency value in Hz into MIDI note value

Parameters:
  • Note[out] MIDI note value

  • Cents[out] Note dispersion

  • FrequencyHz – Frequency value in Hz

static void AmplitudeToDB(float &DB, const float &Amplitude)

Converts amplitude values to decibel scale

Parameters:
  • DB[out] Decibel value

  • Amplitude – Amplitude normalized value

Decoder config

void SetEnableMetadataLoad(bool EnableMetadataLoad)

Enables or disables metadata load

Parameters:

EnableMetadataLoad – Enable metadata load

bool IsAsyncInitAudioRunning() const

Check if there is an async initialization running

Returns:

bool An async initialization is running

Public Functions

UAudioAnalyzerManager()

Construcrtor

~UAudioAnalyzerManager()

Destructor

void EBOnInitPlayerAudioFinished(const bool &Result)

Local event broadcast OnInitPlayerAudioFinished

Parameters:

Result – Initialization result

void EBOnInitExtractorAudioFinished(const bool &Result)

Local event broadcast OnInitExtractorAudioFinished

Parameters:

Result – Initialization result

void EBOnConstructSoundWaveFinished(const bool &Result)

Local event broadcast OnConstructSoundWaveFinished

Parameters:

Result – Initialization result

inline void EBOnPlaybackFinished()

Local event broadcast OnPlaybackFinished

inline void EBOnPlaybackLoopFinished()

Local event broadcast OnPlaybackLoopFinished

inline void EBOnAudioComponentPlaybackFinished()

Local event broadcast OnAudioComponentPlaybackFinished

inline void EBOnAudioComponentPlaybackLoopFinished()

Local event broadcast OnAudioComponentPlaybackLoopFinished

inline void EBOnAudioComponentStopFinished()

Local event broadcast OnAudioComponentStopFinished

inline void EBOnCapturedData(const TArray<uint8> &Buffer)

Local event broadcast OnCapturedData

Parameters:

Buffer – Output pcm audio buffer

inline void EBOnLoopbackCapturedData(const TArray<uint8> &Buffer)

Local event broadcast OnLoopbackCapturedData

Parameters:

Buffer – Output pcm audio buffer