Interface ISoundOptions
interface ISoundOptions {
autoplay?: boolean;
distanceModel?: "linear" | "inverse" | "exponential";
length?: number;
loop?: boolean;
maxDistance?: number;
offset?: number;
playbackRate?: number;
refDistance?: number;
rolloffFactor?: number;
skipCodecCheck?: boolean;
spatialSound?: boolean;
streaming?: boolean;
useCustomAttenuation?: boolean;
volume?: number;
}
autoplay?: boolean;
distanceModel?: "linear" | "inverse" | "exponential";
length?: number;
loop?: boolean;
maxDistance?: number;
offset?: number;
playbackRate?: number;
refDistance?: number;
rolloffFactor?: number;
skipCodecCheck?: boolean;
spatialSound?: boolean;
streaming?: boolean;
useCustomAttenuation?: boolean;
volume?: number;
}
Properties
Optionalautoplay
autoplay?: boolean
Does the sound autoplay once loaded.
Optionaldistance Model
distanceModel?: "linear" | "inverse" | "exponential"
Define the distance attenuation model the sound will follow.
Optionallength
length?: number
Defines an optional length (in seconds) inside the sound file
Optionalloop
loop?: boolean
Does the sound loop after it finishes playing once.
Optionalmax Distance
maxDistance?: number
Maximum distance to hear that sound
Optionaloffset
offset?: number
Defines an optional offset (in seconds) inside the sound file
Optionalplayback Rate
playbackRate?: number
Defines the playback speed (1 by default)
Optionalref Distance
refDistance?: number
Define the reference distance the sound should be heard perfectly.
Optionalrolloff Factor
rolloffFactor?: number
Define the roll off factor of spatial sounds.
Optionalskip Codec Check
skipCodecCheck?: boolean
If true, URLs will not be required to state the audio file codec to use.
Optionalspatial Sound
spatialSound?: boolean
Is it a spatial sound?
Optionalstreaming
streaming?: boolean
Defines if the sound is from a streaming source
Optionaluse Custom Attenuation
useCustomAttenuation?: boolean
Uses user defined attenuation function
Optionalvolume
volume?: number
Sound's volume
Interface used to define options for Sound class