8

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?

Sam
  • 26,817
  • 58
  • 206
  • 383
  • Sam, are you still looking for an answer? You haven't responded to the above two comments yet. Is the solution from them a good enough answer to your question? – akds Jan 09 '22 at 17:38

0 Answers0