question

IvanH-7826 avatar image
0 Votes"
IvanH-7826 asked romungi-MSFT commented

Speech-to-text initialization hanging

Hi, I'm using speech-to-text services C++ SDK for Linux. I've build a test app following the guidelines from here:
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-speech-to-text?tabs=windowsinstall&pivots=programming-language-cpp
It works fine when subscription key is accepted but when there is some issue (e.g. error code 4 about running out of quota) it takes quite a long time (up to 10 seconds) to receive a response and my app freezes. If I move the logic to a separate thread it still causes freezing on the app exit and I receive an error code 6 ("Timeout while waiting for service to stop"). What is worse - sometimes I don't receive any response at all and therefore I need to force terminate my app as it sticks completely.
Is there any ability to reduce this delay? Could you please advise?

azure-speech
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@IvanH-7826 Are you using the free tier for your speech resource? Free tier does have a limit that limits the TPS and the amount of audio and text that can be processed. The quotas and limits page does provide some guidance on some of the quota issues.

For the issue with your app where it needs force terminated I would recommend to check if the same occurs when you change your tier to standard. This should help identify if the issue is with the quota or any dependencies that are required for your app to work on linux.


0 Votes 0 ·

Thanks @romungi-MSFT
But TBH I expected to receive an error message (about limitation) without waiting ~10 seconds. Or, even better, to have an ability to terminate initializing request at any time.
Basically, my question is about the continuous recognition. When should I call this:

recognitionEnd.get_future().get();

Just after StartContinuousRecognitionAsync? Should it be executed in a separate thread?
0 Votes 0 ·

@IvanH-7826 With continuous recognition the call to StopContinuousRecognitionAsync() is required to stop the recognition. I am not sure if the recognition in your case is taking 10 seconds though, depending on the input and audioconfig used.
The call to recognitionEnd.get_future().get(); is after the recognizer->StartContinuousRecognitionAsync().get(); call in the same thread. This sample should help you run and understand the scenario better.




0 Votes 0 ·
Show more comments

0 Answers