For my drum machine I want to use files on my computer instead of linking to a sound online, like in the FCC drum machine example, but when I attempt to play these local files I get these errors:
Chrome:
DOMException: The element has no supported sources.
Firefox:
DOMException: The media resource indicated by the src attribute or assigned media provider object was not suitable
I have gone down the stackoverflow rabbit hole but nothing there has helped. I have tried setting the crossOrigin to anonymous (admittedly maybe not correctly), catching the promise of .play() and making sure the file path is correct. My drum machine works fine when I link directly to a sound online but just not with the local files.
If anyone has any insights into what is happening please let me know.
The specific code I am having trouble with is Here on GitHub (it’s a bit messy with commented out code and other stuff from testing different solutions)
just incase it’s important, I am working in vs code and used create-react-app.