Audio.Manager Class
Manager class is utility for manage all sound in channel.
Constructor
Audio.Manager
()
Item Index
Methods
Methods
_handleAllInstancesReady
-
channel
Used has callback for the allSoundsReady
event.
Parameters:
-
channel
Object
_tellAllInstances
-
command
-
[value]
Applies the command to all channels.
Parameters:
-
command
Stringcommands availables:
"pause"
"resume"
"setVolume"
"mute"
"stop"
-
[value]
optionalargument
add
-
src
-
max
Create new channel with src and max sound instance.
Parameters:
-
src
String | StringThe source(s) of channel. If many values are passed, the first compatibel are used.
-
max
NumberThe number of sound allocated in this channel.
Returns:
get
-
uniqueId
Get a channel.
Parameters:
-
uniqueId
NumberThe id of the channel need get.
Returns:
getMasterVolume
()
Number
Get a current master volume.
Returns:
getPlayableSound
-
uniqueId
Get a playable sound.
Parameters:
-
uniqueId
NumberThe id of the channel need get a sound.
Returns:
loadAll
()
Load all sounds on all channels.
pause
()
Pause all sound in every channel.
remove
-
uniqueId
Remove a channel.
Parameters:
-
uniqueId
NumberThe id of the channel need remove.
Returns:
resume
()
Resume all sound in every channel.
setMasterVolume
-
value
Set a volume for all sound in every channel.
Parameters:
-
value
NumberThe value of volume needed. min: 0.0 -> max: 1.0
setMute
-
isMuted
Mute or Unmute all sound in every channel.
Parameters:
-
isMuted
BooleanTrue for mute or false for unmute.
stop
()
Stop all sound in every channel.
Properties
_instances
Array
private
Array of Channel.
Default: []
_lastId
Number
private
LastId of Channel.
Default: 0
_masterVolume
Number
private
Volume of all sound in all channel, between 0.0 and 1.0.
Default: 1
_ready
Number
private
Number of Channel ready to play.
Default: 0
allInstancesReady
Function
Callback function when all channel is ready to play.
Default: null
instanceReady
Function
Callback function when a channel is ready to play.
Default: null
Sub-properties:
-
id
Numberfirst callback arg; id of ready instance.
length
Number
Number of Channel.
Default: 0