Jump to content

Sound playback stacking - bug?


Red Spark
 Share

Recommended Posts

Hello there!
 
My music cue has two parts in it - an intro and a loop. I want to start playing the loop part once the intro is finished, and for that I'm using onMarkerComplete and a lambda expression.

Here is TypeScript code:

private musicStart ():void{    var music:Phaser.Sound;    music = this.game.add.audio ('Music');    music.addMarker ('intro', 0, 9.06);    music.addMarker ('loop', 9.06, 59.53);    music.play ('intro', 0, 1, false);    music.onMarkerComplete.add (() =>    {        music.play ('loop', 0, 1, true);    });}

And identical JS code:

var music:Phaser.Sound;music = this.game.add.audio ('Music');music.addMarker ('intro', 0, 9.06);music.addMarker ('loop', 9.06, 59.53);music.play ('intro', 0, 1, false);music.onMarkerComplete.add (function (){    music.play ('loop', 0, 1, true);});

It seems to work fine - the intro gracefully switches into the loop part. But that part is played only once, despite having explicit 'true' for looping.

 

It is a bug or a feature?  :huh:

How do I stack sounds one after another?

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...