Class: SoundManager

Phaser. SoundManager

Phaser Sound Manager.

new SoundManager(game)

Sound Manager constructor.

Parameters:
Name Type Description
game Phaser.Game

reference to the current game instance.

Source:

Members

channels

Properties:
Name Type Description
channels number

Description.

Default Value:
  • 32
Source:

context

Properties:
Name Type Description
context Description

Description.

Default Value:
  • null
Source:

game

Properties:
Name Type Description
game Phaser.Game

Local reference to game.

Source:

mute

Properties:
Name Type Description
mute boolean

Gets or sets the muted state of the SoundManager. This effects all sounds in the game.

Source:

noAudio

Properties:
Name Type Description
noAudio boolean

Description.

Default Value:
  • false
Source:

onSoundDecode

Properties:
Name Type Description
onSoundDecode Phaser.Signal

Description.

Source:

touchLocked

Properties:
Name Type Description
touchLocked boolean

Description.

Default Value:
  • false
Source:

usingAudioTag

Properties:
Name Type Description
usingAudioTag boolean

Description.

Default Value:
  • false
Source:

usingWebAudio

Properties:
Name Type Description
usingWebAudio boolean

Description.

Default Value:
  • true
Source:

volume

Properties:
Name Type Description
volume number

Gets or sets the global volume of the SoundManager, a value between 0 and 1.

Source:

Methods

add(key, volume, loop)

Adds a new Sound into the SoundManager.

Parameters:
Name Type Argument Default Description
key string

Asset key for the sound.

volume number <optional>
1

Default value for the volume.

loop boolean <optional>
false

Whether or not the sound will loop.

Source:

<protected> boot()

Initialises the sound manager.

Source:

decode(key, sound)

Decode a sound by its assets key.

Parameters:
Name Type Argument Description
key string

Assets key of the sound to be decoded.

sound Phaser.Sound <optional>

Its buffer will be set to decoded data.

Source:

pauseAll()

Pauses all the sounds in the game.

Source:

resumeAll()

resumes every sound in the game.

Source:

stopAll()

Stops all the sounds in the game.

Source:

unlock()

Enables the audio, usually after the first touch.

Source:

update()

Updates every sound in the game.

Source:
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template.