Skip to content

speech: update to v1 #2175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"allowUrlComments": true
},
"excludeFiles": [
"system-test/data/*",
"test/testdata/*",
"**/src/*/**/*",
"**/system-test/*/**/*",
"**/test/*/**/*",
"**/node_modules/"
]
}
5 changes: 3 additions & 2 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/system-test/data/*
**/test/testdata/*
**/src/*/**/*
**/system-test/*/**/*
**/test/*/**/*
**/node_modules/
26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ var speechClient = speech({
// Detect the speech in an audio file.
speechClient.recognize('./audio.raw', {
encoding: 'LINEAR16',
sampleRate: 16000
sampleRateHertz: 16000
}, function(err, transcript) {
// transcript = 'how old is the Brooklyn Bridge'
});
Expand All @@ -1008,34 +1008,14 @@ fs.createReadStream('./audio.raw')
.pipe(speechClient.createRecognizeStream({
config: {
encoding: 'LINEAR16',
sampleRate: 16000
sampleRateHertz: 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,
// results: "",
// ...
// }
//
// A later "data" event emitted might look like:
// data = {
// endpointerType: Speech.endpointerTypes.END_OF_AUDIO,
// results: "",
// ...
// }
//
// A final "data" event emitted might look like:
// data = {
// endpointerType:
// Speech.endpointerTypes.ENDPOINTER_EVENT_UNSPECIFIED,
// results: "how old is the Brooklyn Bridge",
// ...
// }
// data.results = "how old is the Brooklyn Bridge"
});
```

Expand Down
25 changes: 4 additions & 21 deletions packages/speech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var speech = require('@google-cloud/speech')({
// Detect the speech in an audio file.
speech.recognize('./audio.raw', {
encoding: 'LINEAR16',
sampleRate: 16000
sampleRateHertz: 16000
}, function(err, transcript) {
// transcript = 'how old is the Brooklyn Bridge'
});
Expand All @@ -30,37 +30,20 @@ fs.createReadStream('./audio.raw')
.pipe(speech.createRecognizeStream({
config: {
encoding: 'LINEAR16',
sampleRate: 16000
sampleRateHertz: 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",
// ...
// }
// data.results = "how old is the Brooklyn Bridge"
});

// Promises are also supported by omitting callbacks.
speech.recognize('./audio.raw', {
encoding: 'LINEAR16',
sampleRate: 16000
sampleRateHertz: 16000
}).then(function(data) {
var transcript = data[0];
});
Expand Down
4 changes: 2 additions & 2 deletions packages/speech/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"@google-cloud/common-grpc": "^0.3.0",
"events-intercept": "^2.0.0",
"extend": "^3.0.0",
"google-gax": "^0.12.0",
"google-proto-files": "^0.10.0",
"google-gax": "^0.12.3",
"google-proto-files": "^0.11.0",
"is": "^3.1.0",
"propprop": "^0.3.1",
"pumpify": "^1.3.5",
Expand Down
Loading