Audio.Channel Class
Channel class is utility for manage multiple sound with same source.
Constructor
Audio.Channel
-
src
-
max
-
id
Parameters:
-
src
String | StringThe source(s) of channel. If many values are passed, the first compatible are used.
-
max
NumberThe number of sound allocated in this channel.
-
id
NumberThe identifier of the channel.
Item Index
Properties
Methods
_tellAllSounds
-
command
-
[value]
Applies the command to all sounds.
Parameters:
-
command
Stringcommands availables:
"pause"
"resume"
"setVolume"
"mute"
"stop"
-
[value]
optionalargument
add
-
max
Add max sound instance with sources in channel.
Parameters:
-
max
NumberThe number of sound allocated in this channel.
getPlayableSound
()
Object
Get a playable sound.
Returns:
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
NumberThe value of volume needed. min: 0.0 -> max: 1.0
setMute
-
isMuted
Mute or Unmute all sound in this channel.
Parameters:
-
isMuted
BooleanTrue 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