I have tried to get a audio file I downloaded as an mp3 to play on a webpage once a button is clicked. When I open my html with live server it is working fine. Something with connecting through heroku isn't recognizing the audio file. I've tried many tips from the internet but nothing is working. The file is in the same folder as everything else.
let button = document.querySelector('button')
let audio = new Audio("trash_Kid.mp3")
const buttonAlert = () => {
audio.play();
alert(`Get good kid!`)
}
button.addEventListener('click', buttonAlert)
Try to upload your .mp3 file in some another server and then just reference it with an absolute/external URL. Could be a Heroku limitation with audio files.