<audio id="audio" controls>
<!-- ... Some time later, we decide we should stop the audio element playing and downloading... -->
var audio = document.getElementById("audio");
audio.pause();audio.src = ""; // Stops audio download.
audio.load(); // Initiate a new load, required in Firefox 3.x.
Be aware that this will destroy the media element's decoders, so the element won't be playable anymore, and it will be rendered as an "error cross" if it's in a document. Also in Firefox 3.x you need to call load() after changing the source, whereas in Firefox 4 the load is scheduled to run when you change the src attribute, and the extra load() call is not required.