This a component I used to play mp3 audio files in my react applications.

you can call this function with a play button.

 Source: /g/SCHOOL/Apps/2022/84-words-kinder

  const playAudio = (word) => {
    //alert(word)
    // also available: https://ssl.gstatic.com/dictionary/static/sounds/20200429/teacher--_us_1.mp3 from google
    let audio = new Audio(`https://www.websor.com/pre-school/words/84words/sounds/?w=${word}`)
    //https://stackoverflow.com/questions/16077642/javascript-html5-audio-dont-play-sound-if-already-playing
    if (!playingAudio) {
      playingAudio = true;
      setTimeout(() => {
        playingAudio = false;
        audio.play();
      }, 100);
    }
  }