I'm sure this question has been asked a million times but for some reason I can't find it here on SO. I must be using the wrong keywords.
How do I play an audio alert of my own in my React
app which has a messaging feature and I simply want an audible notification when a new message arrives. I found one npm package but it seems to come with a whole bunch of things I don't need.
I have a small WAV
file of my own and I simply want to play it when a new message for the user arrives.
Do I need to use an external library to be able to invoke a play
method of sorts? Or is there a built-in way to play an audio file in JavaScript
or ReactJs
?