V1 Speech grpc streaming
Hi All, I noticed that previous example of grpc speech streaming for v1beta1 is gone now. Will it be updated for v1? I tried to replace the old library with google.cloud.speech.v1 but there looks to be no support for SpeechStub
So I think you have two issues, which have separate answers:
stream.closed = True doesn't stop the stream
It works for me. Did you add the stream argument to listen_print_loop and pass it in?
single_utterance=True doesn't close stream after first utterance
This appears to be true when using the raw grpc client as well. I filed a bug, but in the meantime, it appears that closing the request stream (eg via stream.closed=True) effectively terminates the connection as well.
I did add the stream argument, but for some reason, setting closed to True doesn't stop the recognition for me. I have to close the pyaudio stream too: self._audio_stream.close_stream() for the recognition to stop. However, that's perfectly fine for my program.
Thanks for all your help! The sample code was a lifesaver :heart:
Oh huh - that's unfortunate. It sounds like you're okay for now, but if you'd like to pursue the issue I'm happy to pursue it with you :-) Maybe open a new issue, though, since it's a bit tangential to this one. It'd also be helpful to include the git diff, and the platform that you're running on, just to try to figure out why I wasn't able to reproduce.
@jerjou @thecodingwizard Hi, does the code above and at https://github.com/GoogleCloudPlatform/python-docs-samples/blob/4c83e78a2f1022738353e960063477f661bc3856/speech/grpc/transcribe_streaming_minute.py#L17 still work for continuing with streaming transcription for however long is needed? I'm not familiar with Python though I may try to convert to Swift.