Welcome to the community. If you just need sound recognition you can try Teachable Machine that makes it easy to recognize short form sounds eg 1 second in length. I have not seen a full voice recognition conversion yet as those tend to be quite large in file size, but sound recognition is most certainly possible. check:

  
      

      teachablemachine.withgoogle.com
  

  
    

Teachable Machine 16

  Train a computer to recognize your own images, sounds, & poses.
        A fast, easy way to create machine learning models for your sites, apps, and more – no expertise or coding required.


  

  
    
    
  

  


And then select audio project. If you like what it trains in browser you can click download on top right and save the model files generated to your computer. All training is done in browser using TensorFlow.js so no server is used here other than to deliver the initial webpage so your sounds are never sent to a server.
If you want to do voice recognition in JavaScript it actually exists via the WebSpeech API:

  
      

      developer.mozilla.org
  

  
    

Using the Web Speech API - Web APIs | MDN 11

  The Web Speech API provides two distinct areas of functionality — speech recognition, and speech synthesis (also known as text to speech, or tts) — which open up interesting new possibilities for accessibility, and control mechanisms. This article...


  

  
    
    
  

  


You do not need TensorFlow.js to use that. It is part of the browser implementation and will use whatever OS level voice recognition exists.
Good luck!