Skip to content

EZ Web Audio / Effect

Interface: Effect

Defined in: effects/index.ts:24

Common interface for all audio effects.

Effects can be added to any Sound, Oscillator, or LayeredSound via addEffect(). All effects support bypass (passthrough) and wet/dry mix controls.

Example

typescript
import { createSound, createGainEffect, createFilterEffect } from 'ez-web-audio'

const sound = await createSound('audio.mp3')
const boost = createGainEffect(audioContext, 1.5)
const filter = createFilterEffect(audioContext, 'lowpass', { frequency: 800 })

sound.addEffect(boost)
sound.addEffect(filter)
sound.play()

// Control effects
boost.bypass = true    // Bypass gain boost
filter.mix = 0.5       // 50% wet/dry mix on filter

Properties

bypass

bypass: boolean

Defined in: effects/index.ts:30

When true, effect is bypassed (passthrough)


input

input: AudioNode

Defined in: effects/index.ts:26

The input AudioNode that receives signal from the chain


mix

mix: number

Defined in: effects/index.ts:32

Wet/dry mix: 0 = fully dry (no effect), 1 = fully wet (full effect)


output

output: AudioNode

Defined in: effects/index.ts:28

The output AudioNode that sends signal to the next in chain