0

I created manifest

var manifest = [{src:"song1.ogg", id:"song1"}
           ,{src:"song2.ogg", id:"song2"}
           ,{src:"song3.ogg", id:"song3"}
           ,{src:"buzz.ogg", id:"buzz"}];

how I can create infinite play list from song1, song2, song3?

Andrey Koltsov
  • 1,956
  • 6
  • 24
  • 43

1 Answers1

1

You can create a function that plays the "next" song, and increments the song index. Listen for the complete event on sounds (onComplete in SoundJS 3 and older, "complete" event in 0.4.0 and newer). When each sound completes, increment the index (reset it if it passes the last index), and play the sound at that index.

Cheers.

Lanny
  • 11,244
  • 1
  • 22
  • 30