Skip to content

Sound Waves API

SoundWaves

Extends Effect.

Factory Function

typescript
createSoundWaves(config?: SoundWavesConfig)

Methods

See Effect for the full method reference: mount(), start(), pause(), resume(), configure(), withFade(), and destroy().

Clicking the canvas adds a temporary burst wave source at the click position.


SoundWavesConfig

typescript
interface SoundWavesConfig {
    speed?: number;
    sources?: number;
    frequency?: number;
    amplitude?: number;
    colors?: string[];
    resolution?: number;
    damping?: number;
    scale?: number;
}
PropertyTypeDefaultDescription
speednumber1Animation speed multiplier.
sourcesnumber3Number of autonomous wave sources.
frequencynumber1Wave frequency multiplier — higher values produce tighter ripples.
amplitudenumber1Wave amplitude multiplier — higher values produce stronger contrast.
colorsstring[]['#1e40af', '#0891b2', '#0d9488', '#2563eb', '#06b6d4']Colors assigned to each wave source, cycling if fewer than sources.
resolutionnumber4Pixel size of each rendered cell (higher = faster but blockier).
dampingnumber0.98Wave attenuation per distance unit — lower values damp waves faster.
scalenumber1Global scale factor.