function Audio() { this.audio = document.getElementById('audio'); this.set_src = function(src) { this.audio.setAttribute('src', src); } this.play = function() { this.audio.play(); } this.pause = function() { this.audio.pause(); } this.stop = function() { this.audio.stop(); } }