GoogleCloudPlatform / android-docs-samples

Apache License 2.0
375 stars 596 forks source link

Speech Service reset for every 30 sec #47

Open dj-4war opened 6 years ago

dj-4war commented 6 years ago

We have an application where we want to be in continuous listen for voice/speech. But as per the sample voice recorder has tor set for every 30 seconds. Is there a limitation on VoiceRecorder that it has to reset on certain time?, we want to have continuous voice recorder without reset? As a work around we we are reseting the resetting the service but we are getting lag in recognition.

SzasznikaJanos commented 6 years ago

mRequestObserver.onNext(StreamingRecognizeRequest.newBuilder() .setStreamingConfig(StreamingRecognitionConfig.newBuilder() .setConfig(RecognitionConfig.newBuilder() .setLanguageCode(getDefaultLanguageCode()) .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16) .setSampleRateHertz(sampleRate) .build()) .setInterimResults(true) .setSingleUtterance(false) // set this to false. .build()) .build());

On the startRecognizing function. The key is setSingleUtterance to false