Interface: IMediaContext

IMediaContext

Represents the audio context for playing back sounds. This can represent either an HTML or WebAudio context.

Properties:
Name Type Description
audioContext AudioContext

Reference to the Web Audio API AudioContext element, if Web Audio is available

filters filters.Filter[]

Collection of global filter

muted boolean

true if all sounds are mute

paused boolean

Set the paused state for all sound

speed number

The speed of all sound

volume number

Volume to apply to all sound

Members

audioContext AudioContext

Reference to the Web Audio API AudioContext element, if Web Audio is available

filters filters.Filter[]

Collection of global filter

muted boolean

true if all sounds are mute

paused boolean

Set the paused state for all sound

speed number

The speed of all sound

volume number

Volume to apply to all sound

Methods

destroy () void

Destroy the context and don't use after this.

refresh () void

Dispatch event to refresh all instances volume, mute, etc.

refreshPaused () void

Dispatches event to refresh the paused state of playing instances.

toggleMute () boolean

Toggle mute for all sounds

Returns:
Type Description
boolean

togglePause () boolean

Toggle pause for all sounds

Returns:
Type Description
boolean