Class: NoAudioSound

Phaser.Sound. NoAudioSound

No audio implementation of the sound. It is used if audio has been disabled in the game config or the device doesn't support any audio.

It represents a graceful degradation of sound logic that provides minimal functionality and prevents Phaser projects that use audio from breaking on devices that don't support any audio playback technologies.


new NoAudioSound(manager, key [, config])

Parameters:
Name Type Argument Default Description
manager Phaser.Sound.NoAudioSoundManager

Reference to the current sound manager instance.

key string

Asset key for the sound.

config Phaser.Types.Sound.SoundConfig <optional>
{}

An optional config object containing default sound settings.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 28)

Methods


addMarker(marker)

Parameters:
Name Type Description
marker Phaser.Types.Sound.SoundMarker

Marker object.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 90)
Returns:

false

Type
boolean

destroy()

Destroys this sound and all associated events and marks it for removal from the sound manager.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 159)
Fires:

pause()

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 131)
Returns:

false

Type
boolean

play( [markerName] [, config])

Parameters:
Name Type Argument Default Description
markerName string | Phaser.Types.Sound.SoundConfig <optional>
''

If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object.

config Phaser.Types.Sound.SoundConfig <optional>

Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 120)
Returns:

false

Type
boolean

removeMarker(markerName)

Parameters:
Name Type Description
markerName string

The name of the marker to remove.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 110)
Returns:

null

Type
null

resume()

Resumes the sound.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 139)
Returns:

false

Type
boolean

stop()

Stop playing this sound.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 149)
Returns:

false

Type
boolean

updateMarker(marker)

Parameters:
Name Type Description
marker Phaser.Types.Sound.SoundMarker

Marker object with updated values.

Since: 3.0.0
Source: src/sound/noaudio/NoAudioSound.js (Line 100)
Returns:

false

Type
boolean