Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/sonidos.js Secret

Created Sep 29, 2020
Embed
What would you like to do?
const cargarSonido = function (fuente) {
const sonido = document.createElement("audio");
sonido.src = fuente;
sonido.setAttribute("preload", "auto");
sonido.setAttribute("controls", "none");
sonido.style.display = "none";
document.body.appendChild(sonido);
return sonido;
}
const sonidoSuperiorIzquierda = cargarSonido("1.mp3"),
sonidoSuperiorDerecha = cargarSonido("2.mp3"),
sonidoInferiorIzquierda = cargarSonido("3.mp3"),
sonidoInferiorDerecha = cargarSonido("4.mp3");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment