JSPM

  • Created
  • Published
  • Downloads 96664
  • Score
    100M100P100Q165674F
  • License Apache-2.0

Cloud Speech Client Library for Node.js

Package Exports

  • @google-cloud/speech

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@google-cloud/speech) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node.js Client for Google Cloud Speech API (Beta)

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 the Google Cloud Speech API.
  3. Setup Authentication.

Installation

$ npm install --save @google-cloud/speech

Preview

SpeechClient

 var speech = require('@google-cloud/speech');

 var client = speech({
    // optional auth parameters.
 });

 var languageCode = 'en-US';
 var sampleRateHertz = 44100;
 var encoding = speech.v1.types.RecognitionConfig.AudioEncoding.FLAC;
 var config = {
     languageCode : languageCode,
     sampleRateHertz : sampleRateHertz,
     encoding : encoding
 };
 var uri = 'gs://gapic-toolkit/hello.flac';
 var audio = {
     uri : uri
 };
 var request = {
     config: config,
     audio: audio
 };
 client.recognize(request).then(function(responses) {
     var response = responses[0];
     // doThingsWith(response)
 })
 .catch(function(err) {
     console.error(err);
 });

Next Steps