springroll.SoundInstance Class

Module: Sound

A playing instance of a sound (or promise to play as soon as it loads). These can only be created through springroll.Sound.instance.play().

pause

()
public

Defined in pause:252

Pauses this SoundInstance.

resume

()
public

Defined in resume:268

Unpauses this SoundInstance.

stop

()
public

Defined in stop:163

Stops this SoundInstance.

unpause

()
deprecated public

Defined in unpause:102

Deprecated: since version 0.4.0

Unpauses this SoundInstance, see resume

updateVolume

(
  • contextVol
)
protected

Defined in updateVolume:189

Updates the volume of this SoundInstance.

Parameters:

  • contextVol Number

    The volume of the sound context that the sound belongs to. If omitted, the volume is automatically collected.

_channel

createjs.SoundInstance private

Defined in _channel:22

SoundJS SoundInstance, essentially a sound channel.

_endCallback

Function private

Defined in _endCallback:36

User's callback function for when the sound ends.

_endFunc

Function private

Defined in _endFunc:29

Internal callback function for when the sound ends.

_fDur

Number private

Defined in _fDur:74

The duration in milliseconds for the fade that this sound instance is performing.

_fEnd

Number private

Defined in _fEnd:81

The starting volume for the fade that this sound instance is performing.

_fEnd

Number private

Defined in _fEnd:88

The ending volume for the fade that this sound instance is performing.

_fTime

Number private

Defined in _fTime:67

The current time in milliseconds for the fade that this sound instance is performing.

_pan

Number private

Defined in _pan:104

The sound pan value, from -1 (left) to 1 (right).

_startFunc

Function private

Defined in _startFunc:43

User's callback function for when the sound starts. This is only used if the sound wasn't loaded before play() was called.

_startParams

Array private

Defined in _startParams:51

An array of relevant parameters passed to play(). This is only used if the sound wasn't loaded before play() was called.

alias

String public

Defined in alias:59

The alias for the sound that this instance was created from.

curVol

Number protected

Defined in curVol:95

The current sound volume (0 to 1). This is multiplied by the sound context's volume. Setting this won't take effect until updateVolume() is called.

globallyPaused

Boolean

Defined in globallyPaused:128

If the sound is paused due to a global pause, probably from the Application.

isValid

Boolean public

Defined in isValid:135

An active SoundInstance should always be valid, but if you keep a reference after a sound stops it will no longer be valid (until the SoundInstance is reused for a new sound).

length

Number public

Defined in length:112

The length of the sound in milliseconds. This is 0 if it hasn't finished loading.

pan

Number public

Defined in pan:233

The sound pan value, from -1 (left) to 1 (right).

paused

Boolean public

Defined in paused:119

If the sound is currently paused. Setting this has no effect - use pause() and resume().

position

Number public

Defined in position:149

The position of the sound playhead in milliseconds, or 0 if it hasn't started playing yet.

volume

Number public

Defined in volume:214

The current sound volume (0 to 1). This is multiplied by the sound context's volume to get the actual sound volume.