I am testing the Speech-To-Text API with audio files and have observed high latency (>25s) from time to time (it happens rarely). The high latency leads to a timeout on my application.
I have already followed the best practices as described in here (https://cloud.google.com/speech-to-text/docs/best-practices-provide-speech-data). My audio files are around 3 - 6 seconds long each. What other Best Practices are advisable to handle the long latency cases? Retry with back-off?
Any hints are greatly appreciated!
Good day @devbox ,
Welcome to Google Cloud Community!
There are several reasons why you are encountering this issue, assuming that all of the best practices were followed.
1. Try checking the endpoint that you are trying to use, if you are using REST, please verify if you are using https://speech.googleapis.com/v1/speech:recognize endpoint, since you've mentioned that your audio files are 3 - 6 seconds long each. This endpoint is used for short audio that is less than 60 seconds.
You can check this link to learn more: https://cloud.google.com/speech-to-text/docs/sync-recognize
2. You can also check this documentation to optimize your audio files. https://cloud.google.com/speech-to-text/docs/optimizing-audio-files-for-speech-to-text
3. You can check if the requests are sent multiple times in a short time, this might have increased the latency.
You can also reach out Google Cloud Support: https://cloud.google.com/support
Hope this will help!