Sound#addMarker()

addMarker(name, start, duration, volume, loop)

Adds a marker into the current Sound. A marker is represented by a unique key and a start time and duration.
This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback.

Parameters
Name Type Argument Default Description
name string

A unique name for this marker, i.e. 'explosion', 'gunshot', etc.

start number

The start point of this marker in the audio file, given in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.

duration number <optional>
1

The duration of the marker in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.

volume number <optional>
1

The volume the sound will play back at, between 0 (silent) and 1 (full volume).

loop boolean <optional>
false

Sets if the sound will loop or not.

Source code: sound/Sound.js (Line 348)
doc_phaser
2017-02-14 11:09:41
Comments
Leave a Comment

Please login to continue.