Class WeightedSound
Constructors
constructor
-
Creates a new WeightedSound from the list of sounds given.
Parameters
- loop: boolean
When true a Sound will be selected and played when the current playing Sound completes.
- sounds: Sound[]
Array of Sounds that will be selected from.
- weights: number[]
Array of number values for selection weights; length must equal sounds, values will be normalized to 1
Returns WeightedSound
- loop: boolean
Properties
is Paused
A Sound is currently paused.
is Playing
A Sound is currently playing.
loop
When true a Sound will be selected and played when the current playing Sound completes.
Accessors
directional Cone Inner Angle
-
get directionalConeInnerAngle(): number
The size of cone in degrees for a directional sound in which there will be no attenuation.
Returns number
-
set directionalConeInnerAngle(value: number): void
The size of cone in degrees for a directional sound in which there will be no attenuation.
Parameters
- value: number
Returns void
directional Cone Outer Angle
-
get directionalConeOuterAngle(): number
Size of cone in degrees for a directional sound outside of which there will be no sound. Listener angles between innerAngle and outerAngle will falloff linearly.
Returns number
-
set directionalConeOuterAngle(value: number): void
Size of cone in degrees for a directional sound outside of which there will be no sound. Listener angles between innerAngle and outerAngle will falloff linearly.
Parameters
- value: number
Returns void
volume
-
get volume(): number
Playback volume.
Returns number
-
set volume(value: number): void
Playback volume.
Parameters
- value: number
Returns void
Wraps one or more Sound objects and selects one with random weight for playback.