title: Getting a google api client error using the Uberi speech to text code
body: <p>I am trying to use Uberi's speech to text code with the google cloud platform (GCP) speech to text API. I am getting the following error: <code>googleapiclient.errors.UnknownApiNameOrVersion: name: speech  version: v1beta1</code></p>
  
  <p>Anyone know how to fix this error? Cant seem to find anything on Uberi github page. Was wondering if anyone has come across a similar error using the GCP or if anyone has a better way of embedding the google API speech-to-text code that works.</p>
  
  <p>The GCP documentation isn't very clear!</p>
  
  <p>I am using the following code:</p>
  
  <pre><code>recognizer = sr.Recognizer()
  pa = pyaudio.PyAudio()
  
  audio_rate = args.rate
  stream_buf = bytes()
  stream_counter = 0
  
  
  def recognize(stream_text):
      global args
  
      def logger(s):
          f = open('recognition_log2.txt', 'a+', encoding='utf-8')
          f.write(datetime.datetime.now().strftime("[ %d-%b-%Y %H:%M:%S ] "))
          f.write(s)
          f.write("\x0A")
          f.close()
  
      audio_data = sr.AudioData(stream_text, audio_rate, 2)
      GOOGLE_CLOUD_SPEECH_CREDENTIALS = r"""{
    "type": "service_account",
    "project_id": "xxx",
    "private_key_id": "xxx",
    "private_key": "xxx",
    "client_email": "xxx",
    "client_id": "xxx",
    "auth_uri": "xxx",
    "token_uri": "xxx",
  }
  """
      try:
          result = recognizer.recognize_google_cloud(audio_data, credentials_json=GOOGLE_CLOUD_SPEECH_CREDENTIALS)
          print(result)
          logger(result)
      except sr.UnknownValueError:
          pass
      except sr.RequestError as e:
          print("Could not request results from GSR service; {0}".format(e))
  
  
  def stream_audio(data):
      global args
      global stream_buf
      global stream_counter
  
      if stream_counter &lt; args.buf:
          stream_buf += data
          stream_counter += 1
      else:
          threading.Thread(target=recognize, args=(stream_buf,)).start()
          stream_buf = bytes()
          stream_counter = 0
  
  
  def callback(in_data, frame_count, time_info, status):
      stream_audio(in_data)
      return (None, pyaudio.paContinue)
  
  
  stream = pa.open(format=pyaudio.paInt16, channels=1, rate=audio_rate, input=True, stream_callback=callback,
                   input_device_index=args.device)
  stream.start_stream()
  while stream.is_active(): time.sleep(0.1)
  stream.stop_stream()
  stream.close()
  pa.terminate()
  </code></pre>