SoundOptions <TName>
Type parameters
- TName: string = string
Index
Properties
optionalbustCache
optionalduration
Seconds?
By default unset, will play the natural length of the clip
optionalloop
Loop infinitely
optionalmaxConcurrentTracks
Maximum number of simultaneously playing tracks allowed for this single
Sound. When the cap is reached, new play() calls are dropped and resolve
to false. Default unset (unbounded).
optionalname
Optional explicit name for this sound. Used as the default key when this
Sound is registered with a SoundManager (otherwise the basename
without extension of the selected path is used, e.g. /sfx/coin.mp3 → coin).
If passed as a string literal, it is inferred as the Sound's name type parameter for strong typing.
optionalonPlay
Optional hook to wire custom Web Audio nodes (spatial panners, filters, reverb, analysers...) between this sound's source and its output. Runs each time a track (re)starts. See AudioGraphBuilder.
paths
optionalpitch
Pitch shift in cents (semitones are 100 cents). Default 0 (no change). Backed by AudioBufferSourceNode.detune; composes with Sound.playbackRate. Note: changing pitch also affects playback speed (this is a Web Audio limitation).
optionalplaybackRate
Multiplyer
By default 1
optionalposition
Advance to a position in the audio clip
optionalvoiceStealing
What happens when a maxConcurrentTracks cap
*false (default) drops the new play
*true stops the oldest playing track in that scope to make room for it.
optionalvolume
[0-1] 0% to 100%
By default 1 (100%)
Optionally bust the cache on load
Default is false