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:
- Select or create a Cloud Platform project.
- Enable the Google Cloud Speech API.
- Setup Authentication.
Installation
$ npm install --save @google-cloud/speechPreview
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
- Read the Client Library Documentation for Google Cloud Speech API to see other available methods on the client.
- Read the Google Cloud Speech API Product documentation to learn more about the product and see How-to Guides.
- View this repository's main README to see the full list of Cloud APIs that we cover.