New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Result event not triggered on file upload #54
Comments
This might be more of a workaround than directly addressing what you see, but... You don't need (unofficial response--I'm not the maintainer or involved with the project) |
Thanks for the fast reply! Indeed AudioStreamer is not usefull in my case. I can replace the function in decodeAudioData to just Unfortunately the error persist: This is what I have now:
|
Hi @Clement-mim ! I assume your audio contains little silence at the end or the model does not have sufficient information to decide it has reached an endpoint (end of utterance; the probability of the recognized text ending a sentence is low). Due to this fact, the end result event is not emitted. When you send the audio twice, the recognizer received double the audio and even if there is not much silence at the end of the audio, the length of the utterance is enough to trigger an endpoint detection. Once you have finished sending audio you should finalize recognition by removing the recognizer with However, I see that this event will not be dispatched to the listeners as is it removed from the list of recognizers before the event is received. I will work on a fix. Moreover, there should be no need to remove and recreate a recognizer to force a FinalResult. I will update the API so it can be triggered independently. If you feel you can contribute these changes let me know! Otherwise I'll make time for them. |
Hello, thanks for pointing me in the right direction. I have just created a PR with a new function "sendResults" that trigger the "result" event. In my code I use it in the "partialresult" callback function (in recognizer.tsx) since I only have one buffer: the whole file. It looks like this:
|
Hello, I am working on a way to pass audio file to the recognizer all at once.
I took the react example and edited file-upload.tsx to send the whole file as buffer to the AudioStreamer "_write" method.
The problem reside on the "result" event of the recognizer not being fired after the process.
The "partialresult" event is called with every words but misses timestamps.
Here is the implementation of the "onChange" function in file-upload.tsx:
I have also noticed when uploading a second file it works well, the result event is triggered and includes both files data.
What I am missing? Is there a way to dispatch a "result" event?
The text was updated successfully, but these errors were encountered: