API Docs for: 0.3.0
Show:

Audio.Channel Class

Module: Audio

Channel class is utility for manage multiple sound with same source.

Constructor

Audio.Channel

(
  • src
  • max
  • id
)

Parameters:

  • src String | String

    The source(s) of channel. If many values are passed, the first compatible are used.

  • max Number

    The number of sound allocated in this channel.

  • id Number

    The identifier of the channel.

Methods

_tellAllSounds

(
  • command
  • [value]
)
private

Applies the command to all sounds.

Parameters:

  • command String

    commands availables:

    • "pause"
    • "resume"
    • "setVolume"
    • "mute"
    • "stop"
  • [value] optional

    argument

add

(
  • max
)

Add max sound instance with sources in channel.

Parameters:

  • max Number

    The number of sound allocated in this channel.

getPlayableSound

() Object

Get a playable sound.

Returns:

Object: A playable sound.

load

()

Load all sound.

pause

()

Pause all sound in this channel.

resume

()

Resume all sound in this channel.

setMasterVolume

(
  • value
)

Set a volume for all sound in this channel.

Parameters:

  • value Number

    The value of volume needed. min: 0.0 -> max: 1.0

setMute

(
  • isMuted
)

Mute or Unmute all sound in this channel.

Parameters:

  • isMuted Boolean

    True for mute or false for unmute.

stop

()

Stop all sound in this channel.

Properties

_sounds

Sound

Array of Sound.

Default: []

_src

String | String private

Source sound for this channel. Can contains many values (first compatible are used).

allSoundsReady

Function

Callback function when all sound is ready to play in this channel.

Default: null

id

Number

Channel id.

Default: id