Back
SoundSource
A node in the scene representing a source of sound.
More
Properties
{SoundAsset}
nowPlaying
Number
playUntilLast
currentTrack
velocity
uid
loop
Methods
constructor
SoundSource
()
undefined
addSound
()
undefined
play
(
Object
asset )
undefined
playAll
(
Object
startTrack )
undefined
setVelocity
()
undefined
getVelocity
()
Description
This can be thought of as a speaker that can play different SoundSources.
Property Description
{SoundAsset}
nowPlaying
The asset currently playing.
Number
playUntilLast
Whether the next song will be played when a song ends.
currentTrack
The index of the asset that is played now or will be played next.
velocity
The velocity of this source.
uid
A unique identifier (local)
loop
Method Description
constructor
SoundSource
()
undefined
addSound
()
Add sound to asset list.
undefined
play
(
Object
asset )
Play a SoundSource asset.
undefined
playAll
(
Object
startTrack )
Play all assets until the last one.
undefined
setVelocity
()
Set the sound source velocity. Set this to change the sound according to the doppler effect.
undefined
getVelocity
()
Get the sound source velocity.