Comments (2)
This is working as expected. Even if you stop sending data there could be a queue of data being recognized by the service and that's why you keep on getting results. It's the developer's responsibility to stop showing results or keep showing them until the service sends the last part.
What you can do is to remove the on data handler once you click on stop or have available to see if you should discard the messages or not.
from speech-javascript-sdk.
Tried both methods you suggested.
1st - I set a flag to true the first time a final data is coming in thus preventing executing the code twice when a second final data is occuring from the queue. Noticed that the outputElement i set as parameter still receives then second final message, so to fix this i kept the text on the first iteration and on the next one i set the saved text on top of the final that included both. A bit crude solution, as i could see the outputElement text changing.
2nd - I prefered unbinding the data handler at the end of all the code i am executing, so no additional text is piped into the outputElement and i don't have to fiddle with flags and saving previous text in order to reset it.
Thank you for your suggestions, works like a charm now.
from speech-javascript-sdk.
Related Issues (20)
- package.json { scripts { ... postinstall: }} only contains shell script for Linux, no batch file for Windows HOT 2
- The Javascript standalone release that isn't Webpack HOT 3
- CORS problem when getting voices () HOT 3
- Error: "Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten on Angular 7 HOT 2
- TextToSpeech for Safari iOS fix. HOT 5
- Requesting new feature to enable NLU service. HOT 3
- RecognizeMicrophone is not able to establish webSocket connection HOT 2
- Error during WebSocket handshake: Unexpected response code: 403 HOT 2
- REST API docs HOT 1
- Difficult integration with Create React app... HOT 2
- Please 1.0 this thing :) HOT 6
- Broken docs link HOT 5
- watsonplatform.net endpoint retirement HOT 3
- recognizeMicrophone function speechDetectorSensitivity and backgroundAudioSuppression can't set as params HOT 2
- The automated release is failing 🚨 HOT 1
- WebSocket connection error due to no access_token HOT 2
- Support for character_insertion_bias HOT 6
- Security Issue HOT 1
- Doesn't work with React 18+ HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speech-javascript-sdk.