Google Streaming Speech Recognition on Python Audio Stream

I have looked through all available google docs but could not find an example of streaming speech recognition in audio stream in Python.

I am currently using Speech Recognition for Python in Django to get audio from the user and then listen to the audio. Then I can save the file and run Google Speech Recognition or directly from the generated audio instance.

Can anyone explain to me how to perform streaming speech recognition on an audio stream?

+3


source to share


1 answer


Google provides an example Python streaming API: https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/speech/cloud-client/transcribe_streaming.py



Instead of opening the audio file to create a stream (as in line 34 of this example), pipe the stream directly to the audio sample object (as in line 36).

+1


source







All Articles