Prueba partiendo de esto:
Código HTML:
Ver original<!doctype html>
<script type="text/javascript"> function init() {
var myAudio = document.getElementById("audio");
myAudio.addEventListener('ended', loopAudio, false);
}
function loopAudio() {
var myAudio = document.getElementById("audio");
myAudio.play();
}
<audio id="audio" src="myAudio.m4a" controls></audio>
Saludos