I’m trying to have a div play a random audio file out of a bunch of audio files every time the user clicks on it. The currently playing audio should stop once the user clicks again so a new file could play.
Stumbled across this, which shows how to have a list of sounds but couldn’t quite figure out how to call a random item from the list on another HTML embed when the user clicks.
I understand some of the code but i’m not fully proficient which is why i’m having such a hard time piecing it all together.
I’ve got nothing working so can’t really share anything, but i’m on my knees here, if anyone has any suggestions or tips on what the framework for this should be or what to do I would very much appreciate it.