Skip to content

Commit d6572c5

Browse files
authored
feat: support audioChannelCount (#289)
1 parent 16a84e9 commit d6572c5

File tree

6 files changed

+32
-23
lines changed

6 files changed

+32
-23
lines changed

packages/google-cloud-node/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ system-test/*key.json
1212
google-cloud-logging-winston-*.tgz
1313
google-cloud-logging-bunyan-*.tgz
1414
package-lock.json
15+
__pycache__

packages/google-cloud-node/protos/google/cloud/speech/v1/cloud_speech.proto

+11
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ message RecognitionConfig {
215215
// for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
216216
int32 sample_rate_hertz = 2;
217217

218+
// *Optional* The number of channels in the input audio data.
219+
// ONLY set this for MULTI-CHANNEL recognition.
220+
// Valid values for LINEAR16 and FLAC are `1`-`8`.
221+
// Valid values for OGG_OPUS are '1'-'254'.
222+
// Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
223+
// If `0` or omitted, defaults to one channel (mono).
224+
// Note: We only recognize the first channel by default.
225+
// To perform independent recognition on each channel set
226+
// `enable_separate_recognition_per_channel` to 'true'.
227+
int32 audio_channel_count = 7;
228+
218229
// This needs to be set to `true` explicitly and `audio_channel_count` > 1
219230
// to get each channel recognized separately. The recognition result will
220231
// contain a `channel_tag` field to state which channel that result belongs

packages/google-cloud-node/src/v1/doc/google/cloud/speech/v1/doc_cloud_speech.js

+11
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ const StreamingRecognitionConfig = {
149149
* This field is optional for `FLAC` and `WAV` audio files and required
150150
* for all other audio formats. For details, see AudioEncoding.
151151
*
152+
* @property {number} audioChannelCount
153+
* *Optional* The number of channels in the input audio data.
154+
* ONLY set this for MULTI-CHANNEL recognition.
155+
* Valid values for LINEAR16 and FLAC are `1`-`8`.
156+
* Valid values for OGG_OPUS are '1'-'254'.
157+
* Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
158+
* If `0` or omitted, defaults to one channel (mono).
159+
* Note: We only recognize the first channel by default.
160+
* To perform independent recognition on each channel set
161+
* `enable_separate_recognition_per_channel` to 'true'.
162+
*
152163
* @property {boolean} enableSeparateRecognitionPerChannel
153164
* This needs to be set to `true` explicitly and `audio_channel_count` > 1
154165
* to get each channel recognized separately. The recognition result will

packages/google-cloud-node/src/v1/speech_client.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,14 @@ class SpeechClient {
342342
* // Handle the operation using the promise pattern.
343343
* client.longRunningRecognize(request)
344344
* .then(responses => {
345-
* const operation = responses[0];
346-
* const initialApiResponse = responses[1];
345+
* const [operation, initialApiResponse] = responses;
347346
*
348347
* // Operation#promise starts polling for the completion of the LRO.
349348
* return operation.promise();
350349
* })
351350
* .then(responses => {
352-
* // The final result of the operation.
353351
* const result = responses[0];
354-
*
355-
* // The metadata value of the completed operation.
356352
* const metadata = responses[1];
357-
*
358-
* // The response of the api call returning the complete operation.
359353
* const finalApiResponse = responses[2];
360354
* })
361355
* .catch(err => {
@@ -382,8 +376,7 @@ class SpeechClient {
382376
* // Handle the operation using the event emitter pattern.
383377
* client.longRunningRecognize(request)
384378
* .then(responses => {
385-
* const operation = responses[0];
386-
* const initialApiResponse = responses[1];
379+
* const [operation, initialApiResponse] = responses;
387380
*
388381
* // Adding a listener for the "complete" event starts polling for the
389382
* // completion of the operation.

packages/google-cloud-node/src/v1p1beta1/speech_client.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,14 @@ class SpeechClient {
342342
* // Handle the operation using the promise pattern.
343343
* client.longRunningRecognize(request)
344344
* .then(responses => {
345-
* const operation = responses[0];
346-
* const initialApiResponse = responses[1];
345+
* const [operation, initialApiResponse] = responses;
347346
*
348347
* // Operation#promise starts polling for the completion of the LRO.
349348
* return operation.promise();
350349
* })
351350
* .then(responses => {
352-
* // The final result of the operation.
353351
* const result = responses[0];
354-
*
355-
* // The metadata value of the completed operation.
356352
* const metadata = responses[1];
357-
*
358-
* // The response of the api call returning the complete operation.
359353
* const finalApiResponse = responses[2];
360354
* })
361355
* .catch(err => {
@@ -382,8 +376,7 @@ class SpeechClient {
382376
* // Handle the operation using the event emitter pattern.
383377
* client.longRunningRecognize(request)
384378
* .then(responses => {
385-
* const operation = responses[0];
386-
* const initialApiResponse = responses[1];
379+
* const [operation, initialApiResponse] = responses;
387380
*
388381
* // Adding a listener for the "complete" event starts polling for the
389382
* // completion of the operation.

packages/google-cloud-node/synth.metadata

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-01-17T12:49:57.662306Z",
2+
"updateTime": "2019-02-04T21:37:22.951258Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.6",
8-
"dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e"
7+
"version": "0.16.8",
8+
"dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05",
16-
"internalRef": "229626798"
15+
"sha": "f26c727dde5051abefc5ad9e7dee82a2686ad2b0",
16+
"internalRef": "232306662"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)