Plugin Documentation

AudioLens
Real-time audio analysis and beat detection

FFT spectrum, onset and beat detection, and a full set of time- and frequency-domain descriptors you can drive gameplay and visuals with.

v1.0.0
UE 4.27 & 5.8
Win64 (verified)
Category Audio
AudioForge optional
Alpha XP

Overview

AudioLens analyses audio as it plays and gives you numbers you can drive gameplay with: spectrum bands, onsets, beats, loudness and timbre descriptors.

Point it at a sound wave, pick a frame size, and read the results every tick — music-reactive visuals, rhythm games, lip-sync approximations, procedural animation, or adaptive mixing.

  • FFT spectrum with selectable window functions
  • Onset detection — five different detection functions
  • Beat detection with kick / snare / hi-hat classification
  • Time-domain features — RMS, peak energy, zero-crossing rate
  • Frequency-domain features — centroid, flatness, crest, rolloff, kurtosis
  • Blueprint and C++ throughout
AudioForge is optional AudioLens builds and runs on its own: feed it PCM through Process Audio Frames and every analyzer works. Install AudioForge only if you also want the convenience nodes that read audio straight out of an imported sound wave; without it those five nodes log an error and return false.

Requirements

RequirementDetails
Unreal Engine4.27 and 5.8 (verified clean on both)
ModulesAudioLens (Runtime)
DependenciesNone. AudioForge is optional — it only enables the five sound-wave reader nodes (Get Audio By …). AudioLens builds and runs without it.
LanguageBlueprints and/or C++
PlatformsWin64 — built and verified. The code carries no Win64-only restriction, but other targets have not been verified by us.

Installation

  1. Copy the AudioLens folder into your project's Plugins/ directory.
  2. C++ projects: regenerate project files and build. Blueprint-only projects: launch the editor and accept the build prompt.
  3. Open Edit → Plugins and confirm AudioLens is enabled.
  4. Optional: if you also own AudioForge, install and enable it the same way to unlock the sound-wave reader nodes. Nothing else is needed.
  5. From C++, add "AudioLens" to PublicDependencyModuleNames.

Quick start

Drive a visualiser from your own audio (no AudioForge needed)

  1. Call Create AudioLens once and store the result.
  2. Each tick, pass a frame of PCM samples (floats in the −1…1 range, e.g. from a submix or capture callback) to Process Audio Frames.
  3. Read Get Magnitude Spectrum for bars, or Is Beat for a pulse.
UAudioLensLibrary* Lens = UAudioLensLibrary::CreateAudioLens();

// every frame, with a buffer of PCM samples you already have:
Lens->ProcessAudioFrames(PcmFrame);

const TArray<float> Spectrum = Lens->GetMagnitudeSpectrum();
const bool bKick = Lens->IsKick();

Optional: read straight from a playing sound wave (with AudioForge)

If AudioForge is installed, the reader nodes can pull the current frame for you:

TArray<float> Frame;
if (Lens->GetAudioByCurrentTime(ImportedWave, Frame))
{
    Lens->ProcessAudioFrames(Frame);
}
Choosing a frame size 1024 samples is a good default. Larger frames give finer frequency resolution but react more slowly; smaller frames react fast but smear the spectrum.

Core analysis

NodeTypeDescription
Create AudioLensCallableCreate an analyser instance.
Process Audio FramesCallableFeed a frame of samples in.
Process MagnitudeCallableFeed a precomputed magnitude spectrum in.
Update Frame SizeCallableChange the analysis window length.
Get Audio By Current TimeCallablePull the frame currently playing. Requires the optional AudioForge.
Get Audio By Time Range / Frame RangeCallablePull an explicit slice. Requires the optional AudioForge.
Get Audio By Time Length / Frame SizeCallablePull a fixed-length slice. Requires the optional AudioForge.

Spectrum and FFT

NodeTypeDescription
Get Magnitude SpectrumPurePer-bin magnitudes for the current frame.
Get FFT Real / Get FFT ImaginaryPureRaw complex FFT output.
Get FFT Real 64PureDouble-precision real component.
Get BandPureMagnitude of a single frequency band.
Get FFT SubbandsPureGrouped subband energies.
Update FFT Subband SizeCallableChange how many subbands are produced.
Get FFT Average Energy / VariancePureEnergy statistics across the spectrum.
Create Hanning / Hamming / Blackman / Tukey / Rectangular WindowPureBuild a window function.
Create Window By TypePureBuild a window from EAnalysisWindowType.

Onset and beat detection

NodeTypeDescription
Create Onset DetectionCallableCreate an onset detector.
Get Energy EnvelopePureOverall energy envelope.
Get Energy DifferencePureFrame-to-frame energy change.
Get Spectral DifferencePureSpectral flux.
Get Spectral Difference HWRPureHalf-wave rectified flux — onsets only.
Get Complex Spectral DifferencePureFlux using magnitude and phase.
Get High Frequency ContentPureWeighted high-frequency energy; good for percussion.
Create Beat DetectionCallableCreate a beat detector.
Is Beat / Is Beat RangePureBeat on a given subband, or across a range.
Is Kick / Is Snare / Is Hi HatPureClassified drum hits.
Update Energy History SizeCallableWindow used for the running average.

Audio features

NodeTypeDescription
Get Root Mean SquarePureRMS level of the frame.
Get Peak EnergyPureLoudest sample in the frame.
Get Zero Crossing RatePureSign changes per frame — noisiness proxy.
Get Spectral CentroidPureCentre of mass of the spectrum — brightness.
Get Spectral FlatnessPureTone versus noise.
Get Spectral CrestPurePeakiness of the spectrum.
Get Spectral RolloffPureFrequency below which most energy sits.
Get Spectral KurtosisPureShape of the spectral distribution.

Window functions

Windowing reduces spectral leakage. Pass one of EAnalysisWindowType to Create Window By Type.

TypeUse it for
RectangularWindowNo windowing. Sharpest response, worst leakage.
HanningWindowGeneral-purpose default; good balance.
HammingWindowSimilar to Hanning, slightly different sidelobes.
BlackmanWindowLowest leakage, widest main lobe.
TukeyWindowAdjustable taper between rectangular and Hanning.

Troubleshooting

SymptomCause and fix
Sound-wave reader nodes return falseThose five nodes need the optional AudioForge plugin. Install and enable it, or pass PCM to Process Audio Frames instead.
All readings are zeroProcess Audio Frames has not been called this frame, or the frame you passed was empty. Confirm the wave is actually playing.
Beat detection never firesEnergy history is too short or too long for the tempo. Tune it with Update Energy History Size.
Spectrum looks smearedApply a window function — Hanning is a good starting point — and check your frame size.

Credits

© 2026 Alpha XP — alphaxp.net. Built and verified for Unreal Engine 4.27 and 5.8.

AudioLens contains no bundled third-party libraries.