title: Audio duration returns NaN
body: <p>Accessing an HTML5 audio element (a .ogg file) with JavaScript in Chrome. The file does play properly, yet somehow it will not recognize the duration. </p>
  
  <p>I just cribbed this code: <a href="https://www.w3schools.com/jsref/prop_audio_duration.asp" rel="noreferrer">https://www.w3schools.com/jsref/prop_audio_duration.asp</a> (I know w3schools isn't great, but it seems like something else is the problem...) </p>
  
  <pre><code>var x = document.getElementById("testTone").duration;
  console.log("duration:"+x);  // duration:NaN
  
  var y = document.getElementById("testTone");
  y.play();   // works!
  </code></pre>
  
  <p>the element...</p>
  
  <pre><code>&lt;audio controls id="testTone"&gt;
      &lt;source src="autoharp/tone0.ogg" type="audio/ogg"&gt;
  &lt;/audio&gt;
  </code></pre>