AudioZoneElement
Represents a spatial audio zone defining how audio behaves and attenuates in a specific area. It supports directional sound cones, distance attenuation models, and transition events.
inOut: boolean
Indicates whether an "in-to-out" transition event should be triggered when the listener leaves the zone.
Example:
audioZone.inOut = true;
outIn: boolean
Indicates whether an "out-to-in" transition event should be triggered when the listener enters the zone.
Example:
audioZone.outIn = true;
distanceModel: string
The distance model used for attenuation of the audio within the zone. Common models include "linear", "inverse", and "exponential".
Example:
audioZone.distanceModel = 'inverse';
refDistance: number
Reference distance for volume reduction calculations. At this distance, the audio volume will be at its maximum before attenuation starts.
Example:
audioZone.refDistance = 5;
maxDistance: number
The maximum distance at which the audio can be heard before it is fully attenuated.
Example:
audioZone.maxDistance = 50;
coneInnerAngle: number
The inner angle (in degrees) of the directional audio cone where the volume is at full strength.
Example:
audioZone.coneInnerAngle = 60;
coneOuterAngle: number
The outer angle (in degrees) of the directional audio cone where the volume decreases to the outer gain.
Example:
audioZone.coneOuterAngle = 120;
coneOuterGain: number
The gain (volume multiplier) applied outside the outer cone angle. Controls how much quieter the audio becomes when outside the directional cone.
Example:
audioZone.coneOuterGain = 0.5;