I'm not sure if this is a bug. I try to make an even 'onclick' on a start bottom and start listening any word to start the program. But right now is playing the first audio automatically every time when I refresh the page after 3 seconds. Did I do something wrong? Any help would be helpful. Thank you in advance.
<script>
if (annyang)
{
function playFirstAudio()
{
audio.src = dir + playList[audioIndex] + extention;
audio.load();
setTimeout(function(){audio.play();}, 3000);
}
var playList = ["1_hello", "2_how_old", "3_what_did_you_make"];
var dir = "sound/";
var extention = ".wav";
var audioIndex = 0;
audio = new Audio();
//annyang.addCallback('start', playFirstAudio);
audio.onended = playFirstAudio();
annyang.debug(true);
};
</script>
<div class="container">
<button id="runProgram" onclick='annyang.start();' class="runProgrambutton">Start</button>
</div>