csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
372 stars 231 forks source link

onResult called after onDone #526

Open bsutton opened 3 months ago

bsutton commented 3 months ago

I've noticed that if I call 'stop', the listener then receives the 'done' status, however I can receive text via the speech.listen callback after the 'done' event arrives.

So how do I correctly determine when all text has arrived?

I was expecting that 'done' would not be sent until all text has been converted and delivered. In this way I would know when I can stop listening for recognize text. As it stands I don't have anyway of knowing that all text has arrived.

BTW: I really don't like how the status comes as a String. This is very error prone when trying to match a status. A enum for the status would be much nicer.