MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / sound

Function sound

assets/js/breakout.js:139–152  ·  view source on GitHub ↗
(src)

Source from the content-addressed store, hash-verified

137ctx.fillText("Lives: "+lives, canvas.width-65, 20);
138}
139function sound(src) {
140 this.sound = document.createElement("audio");
141 this.sound.src = src;
142 this.sound.setAttribute("preload", "auto");
143 this.sound.setAttribute("controls", "none");
144 this.sound.style.display = "none";
145 document.body.appendChild(this.sound);
146 this.play = function(){
147 this.sound.play();
148 }
149 this.stop = function(){
150 this.sound.pause();
151 }
152}
153
154
155function draw() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected