diff --git a/public/audio/colision.m4a b/public/audio/colision.m4a new file mode 100644 index 0000000..e47aee6 Binary files /dev/null and b/public/audio/colision.m4a differ diff --git a/public/audio/colision.wav b/public/audio/colision.wav new file mode 100644 index 0000000..c237385 Binary files /dev/null and b/public/audio/colision.wav differ diff --git a/src/App.css b/src/App.css index 8388aab..2e23ec5 100644 --- a/src/App.css +++ b/src/App.css @@ -64,4 +64,4 @@ body.light-theme { body.dark-theme { background-color: #343a40; /* Color de fondo oscuro */ color: #f8f9fa; /* Color de texto claro */ -} \ No newline at end of file +} diff --git a/src/App.js b/src/App.js index 04de4e0..45c66ba 100644 --- a/src/App.js +++ b/src/App.js @@ -103,6 +103,13 @@ function App() { } }; + const reproducirColision = () => { + const audioColision = new Audio('/audio/colision.wav'); + audioColision.play().catch(error => { + console.error("Error al reproducir audio:", error); + }); + }; + useEffect(() => { const cargarAudios = () => { // Preload audio files (optional but recommended) @@ -115,6 +122,7 @@ function App() { }); const audioVallecas = new Audio(`/audio/vallecas.wav`); // Preload new audio file + const audioColision = new Audio(`/audio/colision.m4a`); }; cargarAudios(); @@ -195,6 +203,10 @@ function App() { + + ); }