v0.41.2
Updating
$ npm install google-cloud@0.41.2๐ฎ๐ Hello, Speech API!
The Cloud Speech API enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Cloud Speech API service.
var gcloud = require('google-cloud');
var speech = gcloud.speech({
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json'
});
// Detect the speech in an audio file.
speech.recognize('./audio.raw', {
encoding: 'LINEAR16',
sampleRate: 16000
}, function(err, transcript) {
// transcript = 'how old is the Brooklyn Bridge'
});
// Detect the speech in an audio file stream.
fs.createReadStream('./audio.raw')
.on('error', console.error)
.pipe(speech.createRecognizeStream({
config: {
encoding: 'LINEAR16',
sampleRate: 16000
},
singleUtterance: false,
interimResults: false
}))
.on('error', console.error)
.on('data', function(data) {
// The first "data" event emitted might look like:
// data = {
// endpointerType: Speech.endpointerTypes.START_OF_SPEECH,
// ...
// }
//
// A later "data" event emitted might look like:
// data = {
// endpointerType: Speech.endpointerTypes.END_OF_AUDIO,
// ...
// }
//
// A final "data" event emitted might look like:
// data = {
// endpointerType: Speech.endpointerTypes.END_OF_AUDIO,
// results: "how old is the Brooklyn Bridge",
// ...
// }
});Features
- Core (#1535, #1590, #1605): Sync dependencies to minimize download and installation time as much as possible.
- Core (#1632): Shrinkwrap our dependencies to improve installation & start-up time for npm@2 users.
- Core (#1589): Enable gzip compression on all HTTP requests. (Thanks, @KidkArolis!)
- Speech (#1406, #1407): Introduce Speech API.