Audio · interface
ZoneShape
A space the listener can be inside, and the tail it lends to everything heard there.
Explained in Your first game.
interface ZoneShapeimport type { ZoneShape } from '@driftengine/audio';In depth
A zone is a return bus carrying a convolver, which is the point of having built a mix tree rather than a fixed set of sends: a room is not a special case in the mixer, it is a bus like any other, and the listener simply decides how much goes to it.
Listener-based, and that is the whole model. Whichever space the listener occupies decides the reverb, for every source at once. Cost: a sound inside a cave heard from outside it does not carry the cave's tail — it carries whatever space the listener is standing in, which is wrong in exactly the case where somebody is listening into a space rather than standing in one. The alternative is a convolver per source, which is the general answer and is priced accordingly. What would make this wrong is a scene whose drama is standing at a threshold listening in; that is when to pay for the other model.
Properties
| Name | Type | Description |
|---|---|---|
xreadonly | number | |
yreadonly | number | |
zreadonly | number | |
radiusreadonly | number | Inside this, the zone is at full wet. |
blendreadonly | number | Metres beyond the radius over which it fades out. Zero is a hard edge, which is audible. |