Home
Docs
InfinityFX
©Copyright2016-2026 InfinityFX. All rights reserved.
InfinityFX®
Lively
v5.0.0
Getting started
Components
Animate
LayoutGroup
TextAnimation
ViewAnimation
Hooks
useAudio
useHover
useLink
useReducedMotion
useScroll
useSpring
useTap
useViewport
useVisible
Links
v4 docs
llms.txt

useAudio

Creates a reactive Link whose value continuously updates to reflect the frequency response of a connected audio element.

Importing

1
import { useAudio } from '@infinityfx/lively/hooks';

Usage

Call signature

1
const [ref, link] = useAudio({ bands, minFrequency, maxFrequency, smoothing })

Parameters

bands?:number = 8

Number of frequency bands to divide the audio spectrum into.

minFrequency?:number = 100

The minimum frequency boundary in hertz.

maxFrequency?:number = 2000

The maximum frequency boundary in hertz.

smoothing?:number = 0.7

A number between 0 and 1 specifying how much temporal smoothing to apply to frequency changes.

Returns

ref:React.RefObject<HTMLAudioElement | null>

A React ref to attach to an HTMLAudioElement.

link:AnimationLink<number[]>

A reactive Link containing an array of normalized frequency values.