Skip to main content
Inspiring
January 8, 2019
Question

mp3 music list

  • January 8, 2019
  • 1 reply
  • 278 views

function init() { 

var myRoot = this; 

 

var queue; 

 

var currentSongIndex = 0; 

var previousSongIndex = currentSongIndex; 

var sources =  

"fransk2.mp3", 

"fransk3.mp3", 

"orup.mp3" 

]; 

 

 

queue = new createjs.LoadQueue(); 

queue.installPlugin(createjs.Sound); 

queue.addEventListener("complete", handleComplete); 

 

queue.loadManifest 

src: sources[0], 

id: "sound1" 

}, 

src: sources[1], 

id: "sound2" 

}, 

src: sources[2], 

id: "sound3" 

); 

function handleComplete(event) 

 

myRoot.playlist = []; 

myRoot.playlist[0] = createjs.Sound.createInstance("sound1"); 

myRoot.playlist[1] = createjs.Sound.createInstance("sound2"); 

myRoot.playlist[2] = createjs.Sound.createInstance("sound3"); 

playSong(currentSongIndex); 

function playSong(index) 

myRoot.playlist[index].play(); 

}

This code above and I want it to play but nothing happens. Now it's just quiet. How I start to play this?

    This topic has been closed for replies.

    1 reply

    Preran
    Community Manager
    Community Manager
    January 22, 2019

    Can you provide us with more information on what you are trying to accomplish this code?

    Thanks,

    Preran