I am working on a personal voice assistant app with python, and I want to add a web-interface to it, to allow using it remotely from any device. I already have a Python side of it, and I want to mix it with web interface. Maybe by listening for a socket in a thread. I am experienced with Python but not so much with JS.
What I ideally need is to have a running python process. Then HTML JS client records user's voice, converts it to text and sends it to the python server. Python server receives the command, and runs a function, and returns a json data like:
'reply':'All done, here is your result',
'audio':path to generated mp3 audio file of speech using customized voice
Works like a charm. Thanks. It allows me to emit events at any time, which makes it really easy to build a HTML+JS based front end UI, interacting in real time with python server.