Skip to content

Commit 21dce32

Browse files
feat: add LRS API (#3702)
* feat: add LRS API PiperOrigin-RevId: 493338018 Source-Link: googleapis/googleapis@380b2f0 Source-Link: googleapis/googleapis-gen@5802e4b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiNTgwMmU0YmQyNDRmMTFhYmY4OGM4ZWUzOTY4ZGMxZDcyODFjNDk2YSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 693d417 commit 21dce32

18 files changed

+17181
-9021
lines changed

packages/google-cloud-texttospeech/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
101101
| Text_to_speech.synthesize_speech | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.synthesize_speech.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-texttospeech/samples/generated/v1/text_to_speech.synthesize_speech.js,samples/README.md) |
102102
| Text_to_speech.list_voices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.list_voices.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.list_voices.js,samples/README.md) |
103103
| Text_to_speech.synthesize_speech | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.synthesize_speech.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech.synthesize_speech.js,samples/README.md) |
104+
| Text_to_speech_long_audio_synthesize.synthesize_long_audio | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-texttospeech/samples/generated/v1beta1/text_to_speech_long_audio_synthesize.synthesize_long_audio.js,samples/README.md) |
104105
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-texttospeech/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-texttospeech/samples/quickstart.js,samples/README.md) |
105106
| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-texttospeech/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-texttospeech/samples/test/quickstart.test.js,samples/README.md) |
106107

packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -58,19 +58,6 @@ service TextToSpeech {
5858
}
5959
}
6060

61-
// The top-level message sent by the client for the `ListVoices` method.
62-
message ListVoicesRequest {
63-
// Optional. Recommended.
64-
// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
65-
// If not specified, the API will return all supported voices.
66-
// If specified, the ListVoices call will only return voices that can be used
67-
// to synthesize this language_code. For example, if you specify `"en-NZ"`,
68-
// all `"en-NZ"` voices will be returned. If you specify `"no"`, both
69-
// `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be
70-
// returned.
71-
string language_code = 1 [(google.api.field_behavior) = OPTIONAL];
72-
}
73-
7461
// Gender of the voice as described in
7562
// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
7663
enum SsmlVoiceGender {
@@ -94,7 +81,7 @@ enum SsmlVoiceGender {
9481
// Configuration to set up audio encoder. The encoding determines the output
9582
// audio format that we'd like.
9683
enum AudioEncoding {
97-
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
84+
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
9885
AUDIO_ENCODING_UNSPECIFIED = 0;
9986

10087
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
@@ -122,6 +109,19 @@ enum AudioEncoding {
122109
ALAW = 6;
123110
}
124111

112+
// The top-level message sent by the client for the `ListVoices` method.
113+
message ListVoicesRequest {
114+
// Optional. Recommended.
115+
// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
116+
// If not specified, the API will return all supported voices.
117+
// If specified, the ListVoices call will only return voices that can be used
118+
// to synthesize this language_code. For example, if you specify `"en-NZ"`,
119+
// all `"en-NZ"` voices will be returned. If you specify `"no"`, both
120+
// `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be
121+
// returned.
122+
string language_code = 1 [(google.api.field_behavior) = OPTIONAL];
123+
}
124+
125125
// The message returned to the client by the `ListVoices` method.
126126
message ListVoicesResponse {
127127
// The list of voices.
@@ -171,8 +171,8 @@ message SynthesizeSpeechRequest {
171171

172172
// Contains text input to be synthesized. Either `text` or `ssml` must be
173173
// supplied. Supplying both or neither returns
174-
// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000
175-
// characters.
174+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The input size is limited to 5000
175+
// bytes.
176176
message SynthesisInput {
177177
// The input source, which is either plain text or SSML.
178178
oneof input_source {
@@ -181,7 +181,7 @@ message SynthesisInput {
181181

182182
// The SSML document to be synthesized. The SSML document must be valid
183183
// and well-formed. Otherwise the RPC will fail and return
184-
// [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
184+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For more information, see
185185
// [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
186186
string ssml = 2;
187187
}
@@ -260,7 +260,7 @@ message AudioConfig {
260260
// converting to the desired sample rate (which might result in worse audio
261261
// quality), unless the specified sample rate is not supported for the
262262
// encoding chosen, in which case it will fail the request and return
263-
// [google.rpc.Code.INVALID_ARGUMENT][].
263+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
264264
int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL];
265265

266266
// Optional. Input only. An identifier which selects 'audio effects' profiles
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.texttospeech.v1beta1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/cloud/texttospeech/v1beta1/cloud_tts.proto";
23+
import "google/longrunning/operations.proto";
24+
import "google/protobuf/timestamp.proto";
25+
26+
option cc_enable_arenas = true;
27+
option csharp_namespace = "Google.Cloud.TextToSpeech.V1Beta1";
28+
option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech";
29+
option java_multiple_files = true;
30+
option java_outer_classname = "TextToSpeechLongAudioSynthesisProto";
31+
option java_package = "com.google.cloud.texttospeech.v1beta1";
32+
option php_namespace = "Google\\Cloud\\TextToSpeech\\V1beta1";
33+
option ruby_package = "Google::Cloud::TextToSpeech::V1beta1";
34+
35+
// Service that implements Google Cloud Text-to-Speech API.
36+
service TextToSpeechLongAudioSynthesize {
37+
option (google.api.default_host) = "texttospeech.googleapis.com";
38+
option (google.api.oauth_scopes) =
39+
"https://www.googleapis.com/auth/cloud-platform";
40+
41+
// Synthesizes long form text asynchronously.
42+
rpc SynthesizeLongAudio(SynthesizeLongAudioRequest)
43+
returns (google.longrunning.Operation) {
44+
option (google.api.http) = {
45+
post: "/v1beta1/{parent=projects/*/locations/*/voices/*}:SynthesizeLongAudio"
46+
body: "*"
47+
};
48+
option (google.longrunning.operation_info) = {
49+
response_type: "SynthesizeLongAudioResponse"
50+
metadata_type: "SynthesizeLongAudioMetadata"
51+
};
52+
}
53+
}
54+
55+
// The top-level message sent by the client for the
56+
// `SynthesizeLongAudio` method.
57+
message SynthesizeLongAudioRequest {
58+
// The resource states of the request in the form of
59+
// projects/*/locations/*/voices/*.
60+
string parent = 1;
61+
62+
// Required. The Synthesizer requires either plain text or SSML as input.
63+
SynthesisInput input = 2 [(google.api.field_behavior) = REQUIRED];
64+
65+
// Required. The configuration of the synthesized audio.
66+
AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED];
67+
68+
// Specifies a Cloud Storage URI for the synthesis results. Must be
69+
// specified in the format: `gs://bucket_name/object_name`, and the bucket
70+
// must already exist.
71+
string output_gcs_uri = 4;
72+
73+
// The desired voice of the synthesized audio.
74+
VoiceSelectionParams voice = 5;
75+
}
76+
77+
// The message returned to the client by the `SynthesizeLongAudio` method.
78+
message SynthesizeLongAudioResponse {}
79+
80+
// Metadata for response returned by the `SynthesizeLongAudio` method.
81+
message SynthesizeLongAudioMetadata {
82+
// Time when the request was received.
83+
google.protobuf.Timestamp start_time = 1;
84+
85+
// Time of the most recent processing update.
86+
google.protobuf.Timestamp last_update_time = 2;
87+
88+
// The progress of the most recent processing update in percentage, ie. 70.0%.
89+
double progress_percentage = 3;
90+
}

0 commit comments

Comments
 (0)