Represents a handle to a sound that has been played. The
handle is required to control the sound while it is playing
(for example, to call stop, setVolume, setPitch,
fade, or seekTo). Infinitely-looping sounds (started
with loop: -1) stop automatically when the last
SoundInstance reference is dropped; retain the handle for
as long as the sound should keep playing.
Gets the identifier of the sound event this instance was
started with.
Methods
fade
fade(duration:number,targetVolume:number):void
Beta
Parameters
duration: number
Duration of the fade in seconds. Must be non-negative.
Minimum value: 0
targetVolume: number
Volume to fade to. Must be non-negative.
Minimum value: 0
Returns void
Remarks
Fades this sound instance from its current volume to the
target volume over the specified duration. To fade in from
silence, call setVolume(0.0) first; to fade out, pass a
target volume of 0.0.
This function can't be called in restricted-execution mode.
pause
pause():void
Beta
Returns void
Remarks
Pauses this sound.
This function can't be called in restricted-execution mode.
resume
resume():void
Beta
Returns void
Remarks
Resumes this sound after a pause.
This function can't be called in restricted-execution mode.
seekTo
seekTo(seconds:number):void
Beta
Parameters
seconds: number
Position to seek to in seconds. Must be non-negative.
Minimum value: 0
Returns void
Remarks
Sets the playback position of this sound instance.
This function can't be called in restricted-execution mode.
setPitch
setPitch(pitch:number):void
Beta
Parameters
pitch: number
Pitch multiplier between 0.01 and 10.0. A value of 1.0 is
normal pitch.
Bounds: [0.009999999776482582, 10]
Returns void
Remarks
Sets the pitch of this sound instance.
This function can't be called in restricted-execution mode.
setVolume
setVolume(volume:number):void
Beta
Parameters
volume: number
Volume level between 0.0 and 10.0.
Bounds: [0, 10]
Returns void
Remarks
Sets the volume of this sound instance.
This function can't be called in restricted-execution mode.
stop
stop():void
Beta
Returns void
Rc
Remarks
Stops this sound instance from playing.
This function can't be called in restricted-execution mode.
Represents a handle to a sound that has been played. The handle is required to control the sound while it is playing (for example, to call
stop,setVolume,setPitch,fade, orseekTo). Infinitely-looping sounds (started withloop: -1) stop automatically when the lastSoundInstancereference is dropped; retain the handle for as long as the sound should keep playing.