API Documentation for: 3.0.0
Show:

SoundInst Class

Defined in: SoundInst:1004
Namespace: cloudkid

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

Methods

pause

() public

Defined in pause:1148

Pauses this SoundInst.

stop

() public

Defined in stop:1111

Stops this SoundInst.

unpause

() public

Defined in unpause:1161

Unpauses this SoundInst.

updateVolume

(
  • contextVol
)
public

Defined in updateVolume:1124

Updates the volume of this SoundInst.

Parameters:

  • contextVol Number

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

Properties

_channel

createjs.SoundInstance private

Defined in _channel:1011

SoundJS SoundInstance, essentially a sound channel.

_endCallback

Function private

Defined in _endCallback:1023

User's callback function for when the sound ends.

_endFunc

Function private

Defined in _endFunc:1017

Internal callback function for when the sound ends.

_fDur

Number private

Defined in _fDur:1054

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

_fEnd

Number private

Defined in _fEnd:1066

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

_fEnd

Number private

Defined in _fEnd:1060

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

_fTime

Number private

Defined in _fTime:1048

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

_startFunc

Function private

Defined in _startFunc:1029

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:1035

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:1041

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

curVol

Number public

Defined in curVol:1072

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.

isValid

Bool public

Defined in isValid:1092

An active SoundInst should always be valid. This is primarily for compatability with cloudkid.Audio.

length

Number public

Defined in length:1079

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

paused

Bool public

Defined in paused:1085

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

position

Number public

Defined in position:1101

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