This is certainly something that’s possible. Especially using the anvil.js tools
With the speech to text I mostly followed the documentation at mdn:
and adapted this example app to work in anvil
https://github.com/mdn/web-speech-api/tree/master/speech-color-changer
for text to speech - mdn has similar docs:
And an example:
https://github.com/mdn/web-speech-api/tree/master/speak-easy-synthesis
When we get into the realms of working with javascript it can feel quite off-piste.
And definitely worth taking the time to read over the docs for anvil.js.
Here are some other recent examples that use anvil.js from the forum and the anvil blog