Closed HiroyasuNishiyama closed 3 years ago
Is it also worth looking at adding a flag (under speech mode only) - for interim results operation - https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/interimResults -or maybe that should possible the default when in click to start and click to stop mode... ie so you get streamed results while in that mode ?
Thoughts ?
Is it also worth looking at adding a flag (under speech mode only) - for interim results operation - https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/interimResults -or maybe that should possible the default when in click to start and click to stop mode... ie so you get streamed results while in that mode ?
In our original implementation, specifying the interim results option would display the intermediate recognition results on the dashboard. I think it can be used for such purposes. However, if the node outputs interim results, distinguishing between the final and intermediate results is needed. I would like to suggest the node outputs interim results to second output port if the interim results option is specified.
Hi. Updated speech recognition mode to use same button mode of audio input with fixes you pointed out. Also added example flows for both mode.
Yes - I think showing intermediate results on the dashboard is one use case - but that could be done via the backend - - IE don't implement in the node itself - if the user wants it they could feed the info back to another widget. I think there are other use cases where you may want ongoing data fed back. I don't think the node / reco engine will handle both modes at once so I don't know how a second output could work. Though once the reco has stopped presumable we can send a done ? so you know the microphone is no longer expected to send more.
Though once the reco has stopped presumable we can send a done ? so you know the microphone is no longer expected to send more.
Changed to set done
property to true
instead of sending a message to second port if interim flag is set.
Looks good now - Using Done works nicely - thank you. only wrinkle I can see is if I drag on a new node and set to reco mode the default time is 0 seconds. It should default to some useful value (maybe 5 to be consistent with the audio mode. ? ) I think leaving as 0 doesn't make sense unless you have intermediate results on by default... which we don't want (I think).
I'm going to merge this as-is and we can work on it from there in master. I won't publish it just yet.
I think leaving as 0 doesn't make sense unless you have intermediate results on by default... which we don't want (I think).
SpeechRecognition
interface outputs a final result for each phrase (at least for Japanese recognition). The interim result will change before fixed as final result.
For this reason, I intentionally set the default value to 0 in speech recognition mode.
Proposed changes
This PR add speech recognition feature to ui_microphone node using SpeechRecognition interface of Web Speech API.
Checklist
grunt
to verify the unit tests pass