Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 29, 2020 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ba4aaf42aa14faad53ad0881c7e30fb8 to your computer and use it in GitHub Desktop.
Save parzibyte/ba4aaf42aa14faad53ad0881c7e30fb8 to your computer and use it in GitHub Desktop.
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