The ended
event is created based on .currentTime
attribute.
http://w3c.github.io/html/semantics-embedded-content.html#eventdef-media-ended
So, all you have to do is set the .currentTime
to zero again.
myAudio.addEventListener("ended", function(){
myAudio.currentTime = 0;
console.log("ended");
});