myVar = setInterval(esperaresposta, 1400);

function esperaresposta() {
    Get("/app/main_.php", 0);

}

function comandoerrordados() {
    var audio = new Audio('/@@admin2025/tocar2.mp3');
    audio.play();
}

function Get(urlapi) {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
        if (this.readyState == 4 && this.status == 200) {
            var json = this.response;
            // CHECK IF json is parcealble
            try {
                status(JSON.parse(json));
            } catch (error) {
                console.log(error)                
            }
        }
    };

    xhttp.open("GET", urlapi, true);
    xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhttp.send();
    return false;
}

function status(json) {
    if (json.comando == "notifyclient") {
        clearInterval(myVar);
        comandoerrordados();
    };
}