Audio · function

noiseBuffer

Placeholder buffer synthesis: the stand-in a sound slot uses until a real file exists for it.

Explained in Your first game.

function noiseBuffer(ctx: BaseAudioContext, seconds: number, decay: number, colour: (t: number) => number): AudioBuffer
import { noiseBuffer } from '@driftengine/audio';

Parameters

ParameterTypeDescription
ctxBaseAudioContext
secondsnumber
decaynumber
colour(t: number) => number

In depth

Deliberately plain, and generic to any game. These exist so a build is audible and its timing can be felt while the real sounds are being made — they are not an attempt at the final thing, and treating them as one is the mistake the whole slot arrangement is designed to prevent.