Is there a way to do speech recognition using p5.js or javascript?

There are many ways you can check the volume of the microphone in p5.js and there is a .AudioIn function to receive data from the mic, but can I use p5.js to do speech recognition(speech-to-text and text-to-speech).

Why am I asking

I am asking this because I need a way to access the client’s microphone using javascript and then convert it using javascript to text and then transfer that to a python flask app server to use that client’s speech recognition to do different things and give prompts(which would also use the speaker, which is text-to-speech) on the flask website. So, is there a way to do that using p5.js or do I need another piece of javascript code?