Skip to content

EZ Web Audio / createReverb

Function: createReverb() ​

Call Signature ​

createReverb(options?): ReverbEffect

Defined in: packages/core/src/effects/reverb-effect.ts:419

Factory function to create a ReverbEffect.

Auto-detects mode from arguments:

  • No args or object → algorithmic reverb (synchronous)
  • String URL → convolution reverb (async, loads impulse response)
  • AudioBuffer → convolution reverb (synchronous)

AudioContext is optional as the first argument.

Parameters ​

options? ​

AlgorithmicReverbOptions

Returns ​

ReverbEffect

Example ​

typescript
// Algorithmic reverb (good defaults)
const reverb = createReverb()

// Algorithmic with options
const reverb2 = createReverb({ decay: 2, damping: 0.4 })

// Convolution from URL (async)
const reverb3 = await createReverb('hall.wav')

// Convolution from AudioBuffer
const reverb4 = createReverb(audioBuffer)

// With explicit AudioContext
const reverb5 = createReverb(audioContext, { decay: 3 })
const reverb6 = await createReverb(audioContext, 'hall.wav')

Call Signature ​

createReverb(audioContext, options?): ReverbEffect

Defined in: packages/core/src/effects/reverb-effect.ts:420

Factory function to create a ReverbEffect.

Auto-detects mode from arguments:

  • No args or object → algorithmic reverb (synchronous)
  • String URL → convolution reverb (async, loads impulse response)
  • AudioBuffer → convolution reverb (synchronous)

AudioContext is optional as the first argument.

Parameters ​

audioContext ​

BaseAudioContext

options? ​

AlgorithmicReverbOptions

Returns ​

ReverbEffect

Example ​

typescript
// Algorithmic reverb (good defaults)
const reverb = createReverb()

// Algorithmic with options
const reverb2 = createReverb({ decay: 2, damping: 0.4 })

// Convolution from URL (async)
const reverb3 = await createReverb('hall.wav')

// Convolution from AudioBuffer
const reverb4 = createReverb(audioBuffer)

// With explicit AudioContext
const reverb5 = createReverb(audioContext, { decay: 3 })
const reverb6 = await createReverb(audioContext, 'hall.wav')

Call Signature ​

createReverb(url, options?): Promise<ReverbEffect>

Defined in: packages/core/src/effects/reverb-effect.ts:422

Factory function to create a ReverbEffect.

Auto-detects mode from arguments:

  • No args or object → algorithmic reverb (synchronous)
  • String URL → convolution reverb (async, loads impulse response)
  • AudioBuffer → convolution reverb (synchronous)

AudioContext is optional as the first argument.

Parameters ​

url ​

string

options? ​

ConvolutionReverbOptions

Returns ​

Promise<ReverbEffect>

Example ​

typescript
// Algorithmic reverb (good defaults)
const reverb = createReverb()

// Algorithmic with options
const reverb2 = createReverb({ decay: 2, damping: 0.4 })

// Convolution from URL (async)
const reverb3 = await createReverb('hall.wav')

// Convolution from AudioBuffer
const reverb4 = createReverb(audioBuffer)

// With explicit AudioContext
const reverb5 = createReverb(audioContext, { decay: 3 })
const reverb6 = await createReverb(audioContext, 'hall.wav')

Call Signature ​

createReverb(audioContext, url, options?): Promise<ReverbEffect>

Defined in: packages/core/src/effects/reverb-effect.ts:423

Factory function to create a ReverbEffect.

Auto-detects mode from arguments:

  • No args or object → algorithmic reverb (synchronous)
  • String URL → convolution reverb (async, loads impulse response)
  • AudioBuffer → convolution reverb (synchronous)

AudioContext is optional as the first argument.

Parameters ​

audioContext ​

BaseAudioContext

url ​

string

options? ​

ConvolutionReverbOptions

Returns ​

Promise<ReverbEffect>

Example ​

typescript
// Algorithmic reverb (good defaults)
const reverb = createReverb()

// Algorithmic with options
const reverb2 = createReverb({ decay: 2, damping: 0.4 })

// Convolution from URL (async)
const reverb3 = await createReverb('hall.wav')

// Convolution from AudioBuffer
const reverb4 = createReverb(audioBuffer)

// With explicit AudioContext
const reverb5 = createReverb(audioContext, { decay: 3 })
const reverb6 = await createReverb(audioContext, 'hall.wav')

Call Signature ​

createReverb(buffer, options?): ReverbEffect

Defined in: packages/core/src/effects/reverb-effect.ts:425

Factory function to create a ReverbEffect.

Auto-detects mode from arguments:

  • No args or object → algorithmic reverb (synchronous)
  • String URL → convolution reverb (async, loads impulse response)
  • AudioBuffer → convolution reverb (synchronous)

AudioContext is optional as the first argument.

Parameters ​

buffer ​

AudioBuffer

options? ​

ConvolutionReverbOptions

Returns ​

ReverbEffect

Example ​

typescript
// Algorithmic reverb (good defaults)
const reverb = createReverb()

// Algorithmic with options
const reverb2 = createReverb({ decay: 2, damping: 0.4 })

// Convolution from URL (async)
const reverb3 = await createReverb('hall.wav')

// Convolution from AudioBuffer
const reverb4 = createReverb(audioBuffer)

// With explicit AudioContext
const reverb5 = createReverb(audioContext, { decay: 3 })
const reverb6 = await createReverb(audioContext, 'hall.wav')

Call Signature ​

createReverb(audioContext, buffer, options?): ReverbEffect

Defined in: packages/core/src/effects/reverb-effect.ts:426

Factory function to create a ReverbEffect.

Auto-detects mode from arguments:

  • No args or object → algorithmic reverb (synchronous)
  • String URL → convolution reverb (async, loads impulse response)
  • AudioBuffer → convolution reverb (synchronous)

AudioContext is optional as the first argument.

Parameters ​

audioContext ​

BaseAudioContext

buffer ​

AudioBuffer

options? ​

ConvolutionReverbOptions

Returns ​

ReverbEffect

Example ​

typescript
// Algorithmic reverb (good defaults)
const reverb = createReverb()

// Algorithmic with options
const reverb2 = createReverb({ decay: 2, damping: 0.4 })

// Convolution from URL (async)
const reverb3 = await createReverb('hall.wav')

// Convolution from AudioBuffer
const reverb4 = createReverb(audioBuffer)

// With explicit AudioContext
const reverb5 = createReverb(audioContext, { decay: 3 })
const reverb6 = await createReverb(audioContext, 'hall.wav')