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?