title: Using Gstreamer with Google speech API (Streaming Transcribe) in C++
body: <p>I am using the Google Speech API from cloud platform for getting speech-to-text of a streaming audio. I have already done the REST API calls using curl <code>POST</code> requests for a <code>short audio file</code> using GCP.</p>
  
  <p>I have seen the <a href="https://cloud.google.com/speech-to-text/docs/streaming-recognize" rel="nofollow noreferrer">documentation</a> of the Google Streaming Recognize, which says <strong>"Streaming speech recognition is available via gRPC only."</strong></p>
  
  <p>I have gRPC (also protobuf) installed in my <strong>OpenSuse Leap 15.0</strong>. Here is the screenshot of the directory.</p>
  
  <p><a href="https://i.stack.imgur.com/eaX5U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eaX5U.png" alt="Directory"></a></p>
  
  <p>Next I am trying to run the streaming_transcribe example from <a href="https://github.com/GoogleCloudPlatform/cpp-docs-samples/tree/master/speech/api" rel="nofollow noreferrer">this link</a>, and I found that the sample program uses a local file as the input but simulate it as a microphone input (catching 64K chunks sequentially) and then send the data to Google server.</p>
  
  <p>For initial tests to check the grpc is correctly set on my system I ran <code>make run_tests</code>. I have changed the Makefile as:</p>
  
  <pre><code>...
  ...Some text as original Makefile
  ...
  .PHONY: all
  all: streaming_transcribe
  googleapis.ar: $(GOOGLEAPIS_CCS:.cc=.o) 
        ar r $@ $?
  streaming_transcribe: streaming_transcribe.o parse_arguments.o googleapis.ar
        $(CXX) $^ $(LDFLAGS) -o $@
  run_tests:
        ./streaming_transcribe -b 16000 resources/audio.raw
        ./streaming_transcribe --bitrate 16000 resources/audio2.raw
        ./streaming_transcribe resources/audio.flac
        ./streaming_transcribe resources/quit.raw
  clean: rm -f *.o streaming_transcribe \
         googleapis.ar \
         $(GOOGLEAPIS_CCS:.cc=.o)
  </code></pre>
  
  <p>This <strong>do not</strong> work well (neither does the orignal Makefile). 
  But the <code>streaming_transcribe.o</code> file is created after running the Makefile. So I manually ran the file and got the following responses</p>
  
  <p><a href="https://i.stack.imgur.com/CNhYp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CNhYp.png" alt="Screenshot2"></a></p>
  
  <p>Any suggestions on how to run the test and use gstreamer instead of the function used for simulating the mic-phone audio?</p>