title: Using Javascript to play an array sequence audio files
body: <p>I'm a beginner of Javascript. And I'm trying to do a little project that can play array audio files sequently. The code below are inside of annyang API. My idea is to wait for 10 seconds after say some certain words and play the first element in the array, and then wait for 10 seconds, play the second element of the array, and so on so forth. Thus, I use the for loop, but I don't why, it always plays the 'oh_interesting_why' which is the third element. </p>
  
  <pre><code>var playList = ["tell_me_more", "why", "oh_interesting_why"];
  
  var dir = "sound/";
  var extention = ".wav";
  var i;
  var agent = navigator.userAgent.toLowerCase();
  
  if (agent.indexOf('firefox') != -1 || agent.indexOf('opera') != -1) {
    extention = ".wav";
  }
  
  //audio = new Audio();
  
  for (i = 0; i &lt; playList.length; i++) {
    audio = new Audio();
    //audio = dir + playList[i] + extention;
    audio.src = dir + playList[i] + extention;
    audio.load();
    setTimeout(function() {
      audio.play();
    }, 10000);
  }
  
  audio.loop = false;
  </code></pre>
  
  <p>I have been struggling with is for 2 days. Can't figure out why.
  I'm open to use jQuery, Javascript, or HTML5. Please help me!!
  Thank you in advance. </p>