Class AbstractSpatialAudioAbstract
Constructors
constructor
-
Returns AbstractSpatialAudio
Properties
Abstractattached Node
The scene node this spatial audio is currently attached to, or null if not attached.
Abstractattachment Type
Which components (position, rotation, or both) of the attached scene node's world transform drive the spatial audio.
- Only meaningful while isAttached is
true.
Abstractcone Inner Angle
The spatial cone inner angle, in radians. Defaults to 2π.
- When the listener is inside the cone inner angle, the volume is at its maximum.
Abstractcone Outer Angle
The spatial cone outer angle, in radians. Defaults to 2π.
- When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.
- When the listener is outside the cone outer angle, the volume is at its minimum.
Abstractcone Outer Volume
The amount of volume reduction outside the coneOuterAngle. Defaults to 0.
Abstractdistance Model
The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to "inverse".
Possible values are:
"linear": The volume is reduced linearly as the source moves away from the listener."inverse": The volume is reduced inversely as the source moves away from the listener."exponential": The volume is reduced exponentially as the source moves away from the listener.
Abstractis Attached
Whether the audio source is attached to a mesh or transform node.
Abstractmax Distance
The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.
- This value is used only when the distanceModel is set to
"linear".
Abstractmin Distance
The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.
- This value is used by all distance models.
Abstractmin Update Time
The minimum update time in seconds of the spatialization if it is attached to a mesh or transform node. Defaults to 0.
- The spatialization's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.
Abstractorientation
The spatial orientation used to determine the direction of the audio source. Defaults to (0, 0, -1).
Abstractpanning Enabled
Whether to spatially pan the audio source. Defaults to true.
When set to false, the source keeps distance attenuation but does not pan between the left and right channels.
Sound cone attenuation is not applied while panning is disabled.
Abstractpanning Model
The spatial panning model. Defaults to "equalpower".
Possible values are:
"equalpower": Represents the equal-power panning algorithm, generally regarded as simple and efficient."HRTF":Renders a stereo output of higher quality than"equalpower"— it uses a convolution with measured impulse responses from human subjects.
Abstractposition
The spatial position. Defaults to (0, 0, 0).
Abstractrolloff Factor
How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.
- This value is used by all distance models.
Abstractrotation
The spatial rotation used to determine the direction of the audio source. Defaults to (0, 0, 0).
Abstractrotation Quaternion
The spatial rotation quaternion used to determine the direction of the audio source. Defaults to (0, 0, 0, 1).
Abstractuse Bounding Box
Whether the spatial audio is positioned using the attached scene node's bounding box (when the node is a mesh) instead of its world transform.
- Only meaningful while isAttached is
true.
Methods
Abstractattach
-
attach(
sceneNode: Nullable<Node>,
useBoundingBox?: boolean,
attachmentType?: SpatialAudioAttachmentType,
): voidAttaches to a scene node.
Detaches automatically before attaching to the given scene node. If
sceneNodeisnullit is the same as callingdetach().Parameters
- sceneNode: Nullable<Node>
The scene node to attach to, or
nullto detach. OptionaluseBoundingBox: booleanWhether to use the bounding box of the node for positioning. Defaults to
false.OptionalattachmentType: SpatialAudioAttachmentTypeWhether to attach to the node's position and/or rotation. Defaults to
PositionAndRotation.
Returns void
- sceneNode: Nullable<Node>
Abstractdetach
-
Detaches from the scene node if attached.
Returns void
Abstractdispose
-
Releases associated resources.
Returns void
Abstractupdate
-
Updates the position and rotation of the associated audio engine object in the audio rendering graph.
This is called automatically by default and only needs to be called manually if automatic updates are disabled.
Returns void
Abstract class representing the
spatialaudio property on a sound or audio bus.See
AudioEngineV2.listener