0

Im new to JS programing and into the programing in general and wanted to ask you how i can done that! I want this timer to play beepsound each second... The problem is that i dont know how to do it... Any help will be good!

The code:

var mTimeLeft = 120;
var timerRunning = false;

function timer(timeLeft) {
    if (!timerRunning || timeLeft <= 0) {
        timerRunning = false;
        return;
    }

    if (timeLeft !== undefined) {
        mTimeLeft = (timeLeft);
    }

    //Set something on the page to show the time left
    $('#time-left').text(parseInt(mTimeLeft) + 'sec');

    mTimeLeft--;
    drawCircle(mTimeLeft * 0.833333);

    if (mTimeLeft <= 0) {
        timerRunning = false;
        return;
    }

    setTimeout(timer, 1000);
}
  • 1
    Just did a quick search for "beep javascript" and found all kinds of questions and answers related to this, like this one: [How do I make Javascript beep?](http://stackoverflow.com/a/23395136/1028949) – jeffjenx May 17 '16 at 20:53
  • 1
    Possible duplicate of [How do I make Javascript beep?](http://stackoverflow.com/questions/879152/how-do-i-make-javascript-beep) – Mephy May 17 '16 at 20:57
  • that would be SO annoying! – Rachel Gallen May 17 '16 at 21:28
  • Rachel it wont be on your website right? So whats the problem? – MarikMayhem May 18 '16 at 08:13

0 Answers0