Audio · interface

MixSnapshot

A mix, remembered: every fader, every mute and every send, at one instant.

Explained in Your first game.

interface MixSnapshot
import type { MixSnapshot } from '@driftengine/audio';

In depth

Insert parameters are deliberately absent, and that is the whole design decision here. The master filter's cutoff is written every frame from whatever the game is doing; a snapshot that captured it would fight that writer, and the winner would be whichever wrote last — which is heard as a filter that sometimes sticks and cannot be reproduced on purpose.

Cost: "underwater" as a snapshot carries its levels and its sends but not its filter, so a consumer wanting both recalls the snapshot and sets the cutoff itself. What would make this wrong is an insert parameter no per-frame code ever touches, which is when capturing it costs nothing; this clause is what to revisit if one arrives.

Properties

NameTypeDescription
levelsreadonlyReadonlyMap<string, number>
mutesreadonlyReadonlyMap<string, boolean>
sendsreadonlyReadonlyMap<string, ReadonlyMap<string, number>>Per bus name, per return bus name, the amount that bus was sending.