API Documentation for: 0.6.0
Show:

AbstractPlugin Class

Defined in: AbstractPlugin:38
Module: SoundJS

Available since 0.6.0

A default plugin class used as a base for all other plugins.

Constructor

AbstractPlugin

()

Defined in AbstractPlugin:38

Available since 0.6.0

Methods

_handlePreloadComplete

() protected

Handles internal preload completion.

_handlePreloadError

(
  • event
)
protected

Handles internal preload erros

Parameters:

_updateVolume

() protected

Defined in _updateVolume:305

Set the gain value for master audio. Should not be called externally.

create

(
  • src
  • startTime
  • duration
)
AbstractSoundInstance

Defined in create:219

Create a sound instance. If the sound has not been preloaded, it is internally preloaded here.

Parameters:

  • src String

    The sound source to use.

  • startTime Number

    Audio sprite property used to apply an offset, in milliseconds.

  • duration Number

    Audio sprite property used to set the time the clip plays for, in milliseconds.

Returns:

AbstractSoundInstance:

A sound instance for playback and control.

getVolume

()

Defined in getVolume:252

Get the master volume of the plugin, which affects all SoundInstances.

Returns:

The volume level, between 0 and 1.

initialize

() deprecated protected

Defined in initialize:99

REMOVED. Removed in favor of using MySuperClass_constructor. See extend and promote for details.

There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance.

isPreloadComplete

(
  • src
)
Boolean

Checks if preloading has finished for a specific source.

Parameters:

  • src String

    The sound URI to load.

Returns:

isPreloadStarted

(
  • src
)
Boolean

Checks if preloading has started for a specific source. If the source is found, we can assume it is loading, or has already finished loading.

Parameters:

  • src String

    The sound URI to check.

Returns:

isSupported

() Boolean static

Defined in isSupported:126

Determine if the plugin can be used in the current browser/OS.

Returns:

Boolean:

If the plugin can be initialized.

preload

(
  • loader
)

Defined in preload:160

Internally preload a sound.

Parameters:

  • loader Loader

    The sound URI to load.

register

(
  • loadItem
  • instances
)
Object

Defined in register:138

Pre-register a sound for preloading and setup. This is called by Sound. Note all plugins provide a Loader instance, which PreloadJS can use to assist with preloading.

Parameters:

  • loadItem String

    An Object containing the source of the audio

  • instances Number

    The number of concurrently playing instances to allow for the channel at any time. Note that not every plugin will manage this value.

Returns:

Object:

A result object, containing a "tag" for preloading purposes.

removeAllSounds

(
  • src
)

Defined in removeAllSounds:208

Remove all sounds added using WebAudioPlugin/register. Note this does not cancel a preload.

Parameters:

  • src String

    The sound URI to unload.

removeSound

(
  • src
)

Defined in removeSound:191

Remove a sound added using WebAudioPlugin/register. Note this does not cancel a preload.

Parameters:

  • src String

    The sound URI to unload.

setMute

(
  • value
)
Boolean

Defined in setMute:261

Mute all sounds via the plugin.

Parameters:

  • value Boolean

    If all sound should be muted or not. Note that plugin-level muting just looks up the mute value of Sound getMute, so this property is not used here.

Returns:

Boolean:

If the mute call succeeds.

setVolume

(
  • value
)
Boolean

Defined in setVolume:239

Set the master volume of the plugin, which affects all SoundInstances.

Parameters:

  • value Number

    The volume to set, between 0 and 1.

Returns:

Boolean:

If the plugin processes the setVolume call (true). The Sound class will affect all the instances manually otherwise.

Properties

_audioSources

Object protected

Defined in _audioSources:65

Object hash indexed by the source URI of each file to indicate if an audio source has begun loading, is currently loading, or has completed loading. Can be used to store non boolean data after loading is complete (for example arrayBuffers for web audio).

_capabilities

Object protected static

Defined in _capabilities:47

The capabilities of the plugin. method and is used internally.

Default: null

_capabilities

Object protected static

Defined in _capabilities:115

The capabilities of the plugin. This is generated via the _generateCapabilities method and is used internally.

Default: null