var soundeffectvolume = 0.4;
var backgroundSound;
    
    if(typeof(Storage) !== "undefined") {
        if (!localStorage.highScore) {
            localStorage.highScore = 0;
        } 
        if(localStorage.playSound){
            soundeffectvolume = localStorage.vol/10;
        }
    }

function load() {
        var queue = new createjs.LoadQueue();
        createjs.Sound.alternateExtensions = ["mp3"];
        queue.installPlugin(createjs.Sound);
        queue.addEventListener("fileload", handleFileLoad);
        queue.loadManifest([
            {id:"fond", src:"asset/FondAcceuil.ogg"}
        ]);
    }
     
    function handleFileLoad(event) {
            // Play the loaded sound
         backgroundSound = createjs.Sound.play("fond", {interrupt: createjs.Sound.INTERRUPT_ALL, loop: -1, volume: soundeffectvolume}); 
        if(localStorage.playSound==0){
            backgroundSound.pause();
        }
    }
    
   function playSoundEffect(){
        load();
   }