Navigation
API > API/Plugins > API/Plugins/AudioSynesthesiaCore
FOnsetStrengthAnalyzer calculates the onset strength from audio.
Onset strength is calculated as the half wave rectificed difference between two spectral frames. This onset strength onset analyzer uses the following approach.
[audio]->[fft]->[mel spectrum]->[diff]->[half wave rectify]->[mean]->[onset strength] | | >-[lag]--|
| Name | FOnsetStrengthAnalyzer |
| Type | class |
| Header File | /Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Public/OnsetAnalyzer.h |
| Include Path | #include "OnsetAnalyzer.h" |
Syntax
class FOnsetStrengthAnalyzer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FOnsetStrengthAnalyzer
(
const FOnsetStrengthSettings& InSettings, |
OnsetAnalyzer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActualFFTSize | int32 | OnsetAnalyzer.h | ||
| ComplexSpectrum | FAlignedFloatBuffer | OnsetAnalyzer.h | ||
| FFT | TUniquePtr< IFFTAlgorithm > | OnsetAnalyzer.h | ||
| LagSpectraIndex | int32 | OnsetAnalyzer.h | ||
| MelSpectrum | TArray< float > | OnsetAnalyzer.h | ||
| MelSpectrumDifference | TArray< float > | OnsetAnalyzer.h | ||
| MelTransform | TUniquePtr< FContiguousSparse2DKernelTransform > | OnsetAnalyzer.h | ||
| PreviousMelSpectra | TArray< FAlignedFloatBuffer > | Array of arrays to hold lag spectra. | OnsetAnalyzer.h | |
| RealSpectrum | FAlignedFloatBuffer | OnsetAnalyzer.h | ||
| Settings | FOnsetStrengthSettings | OnsetAnalyzer.h | ||
| SlidingBuffer | TSlidingBuffer< float > | OnsetAnalyzer.h | ||
| Window | FWindow | OnsetAnalyzer.h | ||
| WindowedSamples | FAlignedFloatBuffer | OnsetAnalyzer.h | ||
| WorkingBuffer | FAlignedFloatBuffer | OnsetAnalyzer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CalculateOnsetStrengths
(
TArrayView< const float > InSamples, |
Calculates onset strengths from audio and fills OutOnsetStrengths with generated onset strengths | OnsetAnalyzer.h | |
void FlushAudio
(
TArray< float >& OutEnvelopeStrengths |
Call when done processing audio for an audio analyzer | OnsetAnalyzer.h | |
void Reset() |
Call to reset internal counters and lag spectra. | OnsetAnalyzer.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static float GetTimestampForIndex
(
const FOnsetStrengthSettings& InSettings, |
Converts an onset strength index into a timestamp. | OnsetAnalyzer.h |