AudioController

AudioController

The main Audio controller

Constructor

new AudioController(micrionon-null, datanon-null, noInitopt)

Create the Audio controller instance
Parameters:
Name Type Attributes Default Description
micrio Micrio The Micrio instance
data AudioData The JSON data
noInit boolean <optional>
false Don't immediately initialize

Classes

AudioController

Members

(non-null) ctx :AudioContext

Currently hooked
Type:
  • AudioContext

(non-null) locations :Locations

Audio locations module
Type:

(non-null) playlist :Playlist

Audio playlist module
Type:

(constant) toggleMute :function

Toggle mute function binding
Type:
  • function

Methods

addOnReady(func)

Add an onready function when audio is loaded
Parameters:
Name Type Description
func function The callback function

fadeIn(duropt)

Do an audio fade in
Parameters:
Name Type Attributes Default Description
dur number <optional>
0.5 Duration

fadeOut(forceSilenceopt, duropt)

Do an audio fade out
Parameters:
Name Type Attributes Default Description
forceSilence boolean <optional>
false Force the muted volume to 0
dur number <optional>
0.5 Duration

fadeTo(vol, duropt)

Fade to the volume
Parameters:
Name Type Attributes Default Description
vol number The target volume
dur number <optional>
0.5 Duration

isEnabled() → {boolean}

Global is enabled getter
Returns:
Is enabled boolean
Type
boolean

mute()

Set muted

setVolume(vol)

Set the volume directly
Parameters:
Name Type Description
vol number The target volume

toggleMute() → {boolean}

Toggle the mute state
Returns:
Muted state
Type
boolean

unmute()

Set unmuted