0

I'm working with the Speech to Text API, and I'm using the example posted at: https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/SpeechRecognitionClient

For some reason, whenever I'm using the app, the client just kills itself at exactly one minute in the following code block (bottom line):

// start streaming the data to the server and collect responses
val requestStream = mSpeechClient.streamingRecognizeCallable()
        .bidiStreamingCall(object : ApiStreamObserver<StreamingRecognizeResponse> {
            override fun onNext(value: StreamingRecognizeResponse) {
                runOnUiThread {
                    when {
                        value.resultsCount > 0 ->
                            mTextView.setText(value.getResults(0).getAlternatives(0).transcript)
             //fails here->    else -> mTextView.setText(getString(R.string.api_error))
                    }

Is that built in? I'm not changing anything from the sample code. Do I need to start and stop in one minute segments?

Wesley
  • 5,381
  • 9
  • 42
  • 65

1 Answers1

0

The 1-minute limit is imposed by the service's quotas & limits. For asynchronous requests (send the whole audio for recognition, receive the result later) it is 180 minutes, but the file must be hosted on Google Drive, and you have to provide the link.

Alexander Solovets
  • 2,447
  • 15
  • 22