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
| Requirement | Details |
|---|
| Unreal Engine | 4.27 and 5.8 (verified clean on both) |
| Modules | AudioLens (Runtime) |
| Dependencies | None. AudioForge is optional — it only enables the five sound-wave reader nodes (Get Audio By …). AudioLens builds and runs without it. |
| Language | Blueprints and/or C++ |
| Platforms | Win64 — built and verified. The code carries no Win64-only restriction, but other targets have not been verified by us. |
Installation
- Copy the
AudioLens folder into your project's Plugins/ directory.
- C++ projects: regenerate project files and build.
Blueprint-only projects: launch the editor and accept the build prompt.
- Open Edit → Plugins and confirm AudioLens is enabled.
- Optional: if you also own AudioForge, install and enable it the same way to unlock the sound-wave reader nodes. Nothing else is needed.
- From C++, add
"AudioLens" to PublicDependencyModuleNames.
Quick start
Drive a visualiser from your own audio (no AudioForge needed)
- Call Create AudioLens once and store the result.
- 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.
- 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
| Node | Type | Description |
|---|
| Create AudioLens | Callable | Create an analyser instance. |
| Process Audio Frames | Callable | Feed a frame of samples in. |
| Process Magnitude | Callable | Feed a precomputed magnitude spectrum in. |
| Update Frame Size | Callable | Change the analysis window length. |
| Get Audio By Current Time | Callable | Pull the frame currently playing. Requires the optional AudioForge. |
| Get Audio By Time Range / Frame Range | Callable | Pull an explicit slice. Requires the optional AudioForge. |
| Get Audio By Time Length / Frame Size | Callable | Pull a fixed-length slice. Requires the optional AudioForge. |
Spectrum and FFT
| Node | Type | Description |
|---|
| Get Magnitude Spectrum | Pure | Per-bin magnitudes for the current frame. |
| Get FFT Real / Get FFT Imaginary | Pure | Raw complex FFT output. |
| Get FFT Real 64 | Pure | Double-precision real component. |
| Get Band | Pure | Magnitude of a single frequency band. |
| Get FFT Subbands | Pure | Grouped subband energies. |
| Update FFT Subband Size | Callable | Change how many subbands are produced. |
| Get FFT Average Energy / Variance | Pure | Energy statistics across the spectrum. |
| Create Hanning / Hamming / Blackman / Tukey / Rectangular Window | Pure | Build a window function. |
| Create Window By Type | Pure | Build a window from EAnalysisWindowType. |
Onset and beat detection
| Node | Type | Description |
|---|
| Create Onset Detection | Callable | Create an onset detector. |
| Get Energy Envelope | Pure | Overall energy envelope. |
| Get Energy Difference | Pure | Frame-to-frame energy change. |
| Get Spectral Difference | Pure | Spectral flux. |
| Get Spectral Difference HWR | Pure | Half-wave rectified flux — onsets only. |
| Get Complex Spectral Difference | Pure | Flux using magnitude and phase. |
| Get High Frequency Content | Pure | Weighted high-frequency energy; good for percussion. |
| Create Beat Detection | Callable | Create a beat detector. |
| Is Beat / Is Beat Range | Pure | Beat on a given subband, or across a range. |
| Is Kick / Is Snare / Is Hi Hat | Pure | Classified drum hits. |
| Update Energy History Size | Callable | Window used for the running average. |
Audio features
| Node | Type | Description |
|---|
| Get Root Mean Square | Pure | RMS level of the frame. |
| Get Peak Energy | Pure | Loudest sample in the frame. |
| Get Zero Crossing Rate | Pure | Sign changes per frame — noisiness proxy. |
| Get Spectral Centroid | Pure | Centre of mass of the spectrum — brightness. |
| Get Spectral Flatness | Pure | Tone versus noise. |
| Get Spectral Crest | Pure | Peakiness of the spectrum. |
| Get Spectral Rolloff | Pure | Frequency below which most energy sits. |
| Get Spectral Kurtosis | Pure | Shape of the spectral distribution. |
Window functions
Windowing reduces spectral leakage. Pass one of
EAnalysisWindowType to Create Window By Type.
| Type | Use it for |
|---|
| RectangularWindow | No windowing. Sharpest response, worst leakage. |
| HanningWindow | General-purpose default; good balance. |
| HammingWindow | Similar to Hanning, slightly different sidelobes. |
| BlackmanWindow | Lowest leakage, widest main lobe. |
| TukeyWindow | Adjustable taper between rectangular and Hanning. |
Troubleshooting
| Symptom | Cause and fix |
|---|
| Sound-wave reader nodes return false | Those five nodes need the optional AudioForge plugin. Install and enable it, or pass PCM to Process Audio Frames instead. |
| All readings are zero | Process Audio Frames has not been called this frame, or the frame you passed was empty. Confirm the wave is actually playing. |
| Beat detection never fires | Energy history is too short or too long for the tempo. Tune it with Update Energy History Size. |
| Spectrum looks smeared | Apply 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.