So I've put my sound file in a sub folder of my code directory and whenever I try to play it, it says it can't find it.
Here's my code:
PlaySound = function () {
var audio = new Audio('~/Content/Sound/Down.mp3');
audio.loop = false;
audio.play();
}
Anyone know why?
This is the error I get when I inspect:
GET http://localhost:5/~/Content/Sound/Down.mp3
localhost/:1 Uncaught (in promise) DOMException: Failed to load
because no supported source was found.
wwwdata
or something similar)?http://localhost:5/~/Content/Sound/Down.mp3
from your browser?~
means that you start at your home directory