Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

feat: support audioChannelCount #289

Merged
merged 1 commit into from
Feb 4, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ system-test/*key.json
google-cloud-logging-winston-*.tgz
google-cloud-logging-bunyan-*.tgz
package-lock.json
__pycache__
11 changes: 11 additions & 0 deletions protos/google/cloud/speech/v1/cloud_speech.proto
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ message RecognitionConfig {
// for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
int32 sample_rate_hertz = 2;

// *Optional* The number of channels in the input audio data.
// ONLY set this for MULTI-CHANNEL recognition.
// Valid values for LINEAR16 and FLAC are `1`-`8`.
// Valid values for OGG_OPUS are '1'-'254'.
// Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
// If `0` or omitted, defaults to one channel (mono).
// Note: We only recognize the first channel by default.
// To perform independent recognition on each channel set
// `enable_separate_recognition_per_channel` to 'true'.
int32 audio_channel_count = 7;

// This needs to be set to `true` explicitly and `audio_channel_count` > 1
// to get each channel recognized separately. The recognition result will
// contain a `channel_tag` field to state which channel that result belongs
Expand Down
11 changes: 11 additions & 0 deletions src/v1/doc/google/cloud/speech/v1/doc_cloud_speech.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ const StreamingRecognitionConfig = {
* This field is optional for `FLAC` and `WAV` audio files and required
* for all other audio formats. For details, see AudioEncoding.
*
* @property {number} audioChannelCount
* *Optional* The number of channels in the input audio data.
* ONLY set this for MULTI-CHANNEL recognition.
* Valid values for LINEAR16 and FLAC are `1`-`8`.
* Valid values for OGG_OPUS are '1'-'254'.
* Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
* If `0` or omitted, defaults to one channel (mono).
* Note: We only recognize the first channel by default.
* To perform independent recognition on each channel set
* `enable_separate_recognition_per_channel` to 'true'.
*
* @property {boolean} enableSeparateRecognitionPerChannel
* This needs to be set to `true` explicitly and `audio_channel_count` > 1
* to get each channel recognized separately. The recognition result will
Expand Down
11 changes: 2 additions & 9 deletions src/v1/speech_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,14 @@ class SpeechClient {
* // Handle the operation using the promise pattern.
* client.longRunningRecognize(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -382,8 +376,7 @@ class SpeechClient {
* // Handle the operation using the event emitter pattern.
* client.longRunningRecognize(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down
11 changes: 2 additions & 9 deletions src/v1p1beta1/speech_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,14 @@ class SpeechClient {
* // Handle the operation using the promise pattern.
* client.longRunningRecognize(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Operation#promise starts polling for the completion of the LRO.
* return operation.promise();
* })
* .then(responses => {
* // The final result of the operation.
* const result = responses[0];
*
* // The metadata value of the completed operation.
* const metadata = responses[1];
*
* // The response of the api call returning the complete operation.
* const finalApiResponse = responses[2];
* })
* .catch(err => {
Expand All @@ -382,8 +376,7 @@ class SpeechClient {
* // Handle the operation using the event emitter pattern.
* client.longRunningRecognize(request)
* .then(responses => {
* const operation = responses[0];
* const initialApiResponse = responses[1];
* const [operation, initialApiResponse] = responses;
*
* // Adding a listener for the "complete" event starts polling for the
* // completion of the operation.
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-01-17T12:49:57.662306Z",
"updateTime": "2019-02-04T21:37:22.951258Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.6",
"dockerImage": "googleapis/artman@sha256:12722f2ca3fbc3b53cc6aa5f0e569d7d221b46bd876a2136497089dec5e3634e"
"version": "0.16.8",
"dockerImage": "googleapis/artman@sha256:75bc07ef34a1de9895c18af54dc503ed3b3f3b52e85062e3360a979d2a0741e7"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0ac60e21a1aa86c07c1836865b35308ba8178b05",
"internalRef": "229626798"
"sha": "f26c727dde5051abefc5ad9e7dee82a2686ad2b0",
"internalRef": "232306662"
}
},
{
Expand Down