Interface ISpatialAudioOptions
spatialAutoUpdate: boolean;
spatialConeInnerAngle: number;
spatialConeOuterAngle: number;
spatialConeOuterVolume: number;
spatialDistanceModel: "linear" | "inverse" | "exponential";
spatialEnabled: boolean;
spatialMaxDistance: number;
spatialMinDistance: number;
spatialMinUpdateTime: number;
spatialOrientation: Vector3;
spatialPanningEnabled: boolean;
spatialPanningModel: "equalpower" | "HRTF";
spatialPosition: Vector3;
spatialRolloffFactor: number;
spatialRotation: Vector3;
spatialRotationQuaternion: Quaternion;
}
Hierarchy (View Summary)
- ISpatialAudioOptions
Index
Properties
Properties
spatial Auto Update
Whether to automatically update the spatial properties of the audio node. Defaults to true.
spatial Cone 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.
spatial Cone 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.
spatial Cone Outer Volume
The amount of volume reduction outside the spatialConeOuterAngle. Defaults to 0.
spatial Distance 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.
spatial Enabled
Enable spatial audio. Defaults to false.
When set to true, the audio node's spatial properties will be initialized on creation and there will be no
delay when setting the first spatial value.
When not specified, or set to false, the audio node's spatial properties will not be initialized on creation
and there will be a small delay when setting the first spatial value.
- This option is ignored if any other spatial options are set.
spatial Max 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 spatialDistanceModel is set to
"linear".
spatial Min 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.
spatial Min 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.
spatial Orientation
The spatial orientation used to determine the direction of the audio source. Defaults to (0, 0, -1).
spatial Panning 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.
spatial Panning Model
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.
spatial Position
The spatial position. Defaults to (0, 0, 0).
spatial Rolloff 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.
spatial Rotation
The spatial rotation, as Euler angles. Defaults to (0, 0, 0).
spatial Rotation Quaternion
The spatial rotation, as a quaternion. Defaults to (0, 0, 0, 1).
Options for spatial audio.