Closed chathuralakmal closed 7 years ago
There are several possibilities here, depending on the particular function that you are executing:
SpeechToText.recognizeMicrophone
: If you are executing recognizeMicrophone
, then it seems like the initial recognizeMicrophone
was never stopped with a call to stopRecognizeMicrophone
. Instead, an additional recognizeMicrophone
function starts executing in parallel, causing you to receive duplicate results. If this is the case, then update your app to run stopRecognizeMicrophone
.
SpeechToText.recognize
: If you are executing the recognize
function, then I'm not sure what may be causing the problem. The recognize
function should always create a new session, send the audio data, then close the session and disconnect. For reference, here is that code. If this is the case, then I would recommend checking your app to ensure that you are not accidentally calling recognize in quick succession.
SpeechToTextSession.recognize
: The SpeechToTextSession
class provides more advanced control over the WebSockets session with the Speech to Text service. If you are using the SpeechToTextSession
class, then you need to manually run the stopRequest
and disconnect
functions after sending your audio.
The first time i tried speechToText.recognize() it works pretty well and get me data. but when i call it again pressing same button. it gets duplicate with previous data as well. if i force exit the app and open then it works fine again. is there anyway to timeout that problem?