Saving bytearray in the database and controlling the speech recognition
flow when the browser is closed