mp3 in github #123801
Unanswered
Ivanveliz
asked this question in
Programming Help
mp3 in github
#123801
Replies: 3 comments
-
The issue might be due to incorrect file paths when deployed. Ensure the paths to your sound files are correct relative to the deployed environment. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try directly accessing the sound file in your browser, like https://user.github/repository/sounds/start.mp3 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Can you share a link to the file that this code is in? It might help to debug the issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
"I'm having an issue with sound files:
I'm building an application where I have a timer. When the timer finishes or starts, it triggers an event to play a sound. It works fine locally, but when I upload it to GitHub Pages, I get the following error: "Failed to load resource: the server responded with a status of 404 ()". Does anyone know how I could solve this?"
This is the component's sounds
export default function playSound() {
const audio = new Audio('../../sounds/start.mp3');
return {
play: function() {
audio.play();
}
};
}
This is the function's startCouwndown
const sound = playSound();
function startCountDown() {
Beta Was this translation helpful? Give feedback.
All reactions