Audio Analyzer
Updated
Gives live frequency data for audio-reactive visuals.
- Type
comp-audio-analyzer- Script class
AudioAnalyzerComponent- Per entity
- One
- Version
- 1.2.0
Read about it in Audio sources: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
fftSize |
integer |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A speaker that throbs to the bassAn Audio Analyzer on a looping beat: each frame a Behavior script averages the lowest frequency bins and scales the speaker cone with them.
Click once to let the browser start the sound, then watch the amber cone jump on every kick drum. The beat is a short loop generated for this example. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AudioAnalyzerComponent); if (component) log(component.props);}