Closed 0x213F closed 3 years ago
Hi @0x213F Your report does indeed contain sufficient information, thank you. And your hypothesis is correct.
May I ask what event data you need to access besides the transcript?
In the meantime, you could try this workaround:
const recognition = SpeechRecognition.getRecognition()
const onResult = recognition.onresult
recognition.onresult = (e) => {
// run custom code here...
onResult(e)
}
Summary
I want to keep track of the raw interim transcript data accessible from
recognition.onresult
. As such, I wrote the following code:interimTranscript
does not fit my use case because I am looking to go beyond just a string; I want all the event data has to offer.Observed behavior
When I try reading
transcript
it is empty.Expected behavior
I should be able to run code
onresult
and still be able to access the transcript throughreact-speech-recognition
.Hypothesis
Overriding
recognition.onresult
screws up the internals ofreact-speech-recognition
, resulting in the transcript being empty.Next steps
Can someone validate or invalidate my hypothesis? Have I included sufficient information in this report, or should I give more details?
If there is any work that needs to be done here (and I may be of assistance), I am available to make a PR.