Skip to content
This repository was archived by the owner on Aug 25, 2022. It is now read-only.

Latest commit

 

History

History
49 lines (42 loc) · 1.86 KB

File metadata and controls

49 lines (42 loc) · 1.86 KB

Ruby Client for Google Cloud Speech API (Alpha)

Google Cloud Speech API: Google Cloud Speech API.

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Google Cloud Speech API.
  4. Setup Authentication.

Installation

$ gem install google-cloud-speech

Preview

SpeechClient

require "google/cloud/speech"

speech_client = Google::Cloud::Speech.new
language_code = "en-US"
sample_rate_hertz = 44100
encoding = :FLAC
config = {
  language_code: language_code,
  sample_rate_hertz: sample_rate_hertz,
  encoding: encoding
}
uri = "gs://gapic-toolkit/hello.flac"
audio = { uri: uri }
response = speech_client.recognize(config, audio)

Next Steps