0

I am trying to use setinterval, so I created another script for the same web of a stackoverflow post, saying that a mp3 should keep active the web, but mine still without working, this is my code of howwlr on tampermonkey :

// @require https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.15/howler.core.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.15/howler.min.js
// ==/UserScript==

(function() {
    'use strict';


function performance_trick()
{
    if(sounds.empty) return sounds.empty.play();
    sounds.empty = new Howl({
        src: ['http://adventure.land/sounds/loops/empty_loop_for_js_performance.ogg','http://adventure.land/sounds/loops/empty_loop_for_js_performance.wav'],
       volume:0.5,
        autoplay: true, loop: true,
    });
}

performance_trick();

})();

Someone know what I am missing?

Just checked error console, is like not working the core

ReferenceError: sounds is not defined
    at performance_trick (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:28)
    at eval (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:36)
    at Window.eval (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:38)
    at <anonymous>:2:491
    at eval (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:2)
    at eval (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:3)
    at Object.eval (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:39)
    at eval (userscript.html?id=8fbfbb66-2c0a-427e-8fd7-9c1d5b47cc87:41)
    at eval (<anonymous>)
    at <anonymous>:2:491

0 Answers0