title: How to determine if playing HTML5 audio is actually making sound?
body: <p>For the purposes of a project I am working, I want to find out via the JS console if the &lt;audio&gt; tag found on facebook.com is playing audio or not. (I can then move this code into a Chrome extension and also apply it against other websites such as silent HTML5 ads.)</p>
  
  <p>You can find the element by typing: </p>
  
  <pre><code>$$("audio")[0] 
  </code></pre>
  
  <p>I have used the following code (adapted from <a href="http://jsfiddle.net/aarongloege/fzXsT/light/" rel="nofollow">this jsfiddle</a> which I found during a search) to show when different event listeners are called:</p>
  
  <pre><code>var audio = $$("audio")[0]; 
  var events = 'abort,canplay,canplaythrough,durationchange,emptied,ended,error,loadeddata,loadedmetadata,loadstart,pause,play,playing,progress,ratechange,seeked,seeking,stalled,suspend,timeupdate,volumechange,waiting'.split(',');
  
  // event handler
  var onEvent = function(e) {
      console.log(e.type);
  };
  
  // add event listener to audio for all events
  for (var i = 0, len = events.length; i &lt; len; i++) {
      audio.addEventListener(events[i], onEvent, false);
  }
  </code></pre>
  
  <p>I would then play the audio by typing:</p>
  
  <pre><code>$$("audio")[0].play();
  </code></pre>
  
  <p>If I check $$("audio")[0].paused, it will show false, but I haven't found any properties or events that would indicate whether it played sound or not. (I wouldn't expect it to here since I don't think it has audio data to play, but if there was a way to check, I could compare that with an audio element that does play sound.)</p>
  
  <p>Also, I have tried sending myself a message from an incognito tab and don't see a trace of this happening. (I assume the audio element gets used for that.)</p>
  
  <p>Help is appreciated.</p>