Skip to content

Commit 8681efd

Browse files
Google APIscopybara-github
authored andcommitted
fix!: correct long audio synthesis HTTP binding
docs: Deprecate the custom voice usage field PiperOrigin-RevId: 595159412
1 parent 0fe7f81 commit 8681efd

3 files changed

Lines changed: 36 additions & 24 deletions

File tree

google/cloud/texttospeech/v1beta1/cloud_tts.proto

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 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.
@@ -37,7 +37,8 @@ option (google.api.resource_definition) = {
3737
// Service that implements Google Cloud Text-to-Speech API.
3838
service TextToSpeech {
3939
option (google.api.default_host) = "texttospeech.googleapis.com";
40-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
40+
option (google.api.oauth_scopes) =
41+
"https://www.googleapis.com/auth/cloud-platform";
4142

4243
// Returns a list of Voice supported for synthesis.
4344
rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) {
@@ -49,7 +50,8 @@ service TextToSpeech {
4950

5051
// Synthesizes speech synchronously: receive results after all text input
5152
// has been processed.
52-
rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) {
53+
rpc SynthesizeSpeech(SynthesizeSpeechRequest)
54+
returns (SynthesizeSpeechResponse) {
5355
option (google.api.http) = {
5456
post: "/v1beta1/text:synthesize"
5557
body: "*"
@@ -81,7 +83,8 @@ enum SsmlVoiceGender {
8183
// Configuration to set up audio encoder. The encoding determines the output
8284
// audio format that we'd like.
8385
enum AudioEncoding {
84-
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
86+
// Not specified. Will return result
87+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
8588
AUDIO_ENCODING_UNSPECIFIED = 0;
8689

8790
// Uncompressed 16-bit signed little-endian samples (Linear PCM).
@@ -171,8 +174,8 @@ message SynthesizeSpeechRequest {
171174

172175
// Contains text input to be synthesized. Either `text` or `ssml` must be
173176
// supplied. Supplying both or neither returns
174-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The input size is limited to 5000
175-
// bytes.
177+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The
178+
// input size is limited to 5000 bytes.
176179
message SynthesisInput {
177180
// The input source, which is either plain text or SSML.
178181
oneof input_source {
@@ -181,17 +184,18 @@ message SynthesisInput {
181184

182185
// The SSML document to be synthesized. The SSML document must be valid
183186
// and well-formed. Otherwise the RPC will fail and return
184-
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For more information, see
187+
// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For
188+
// more information, see
185189
// [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
186190
string ssml = 2;
187191
}
188192
}
189193

190194
// Description of which voice to use for a synthesis request.
191195
message VoiceSelectionParams {
192-
// Required. The language (and potentially also the region) of the voice expressed as a
193-
// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
194-
// "en-US". This should not include a script tag (e.g. use
196+
// Required. The language (and potentially also the region) of the voice
197+
// expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
198+
// language tag, e.g. "en-US". This should not include a script tag (e.g. use
195199
// "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
196200
// from the input provided in the SynthesisInput. The TTS service
197201
// will use this parameter to help choose an appropriate voice. Note that
@@ -277,9 +281,8 @@ message AudioConfig {
277281

278282
// Description of the custom voice to be synthesized.
279283
message CustomVoiceParams {
280-
// The usage of the synthesized audio. You must report your honest and
281-
// correct usage of the service as it's regulated by contract and will cause
282-
// significant difference in billing.
284+
// Deprecated. The usage of the synthesized audio. Usage does not affect
285+
// billing.
283286
enum ReportedUsage {
284287
// Request with reported usage unspecified will be rejected.
285288
REPORTED_USAGE_UNSPECIFIED = 0;
@@ -297,13 +300,12 @@ message CustomVoiceParams {
297300
// Required. The name of the AutoML model that synthesizes the custom voice.
298301
string model = 1 [
299302
(google.api.field_behavior) = REQUIRED,
300-
(google.api.resource_reference) = {
301-
type: "automl.googleapis.com/Model"
302-
}
303+
(google.api.resource_reference) = { type: "automl.googleapis.com/Model" }
303304
];
304305

305-
// Optional. The usage of the synthesized audio to be reported.
306-
ReportedUsage reported_usage = 3 [(google.api.field_behavior) = OPTIONAL];
306+
// Optional. Deprecated. The usage of the synthesized audio to be reported.
307+
ReportedUsage reported_usage = 3
308+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
307309
}
308310

309311
// The message returned to the client by the `SynthesizeSpeech` method.

google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 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.
@@ -42,12 +42,12 @@ service TextToSpeechLongAudioSynthesize {
4242
rpc SynthesizeLongAudio(SynthesizeLongAudioRequest)
4343
returns (google.longrunning.Operation) {
4444
option (google.api.http) = {
45-
post: "/v1beta1/{parent=projects/*/locations/*/voices/*}:SynthesizeLongAudio"
45+
post: "/v1beta1/{parent=projects/*/locations/*}:synthesizeLongAudio"
4646
body: "*"
4747
};
4848
option (google.longrunning.operation_info) = {
49-
response_type: "SynthesizeLongAudioResponse"
50-
metadata_type: "SynthesizeLongAudioMetadata"
49+
response_type: "google.cloud.texttospeech.v1beta1.SynthesizeLongAudioResponse"
50+
metadata_type: "google.cloud.texttospeech.v1beta1.SynthesizeLongAudioMetadata"
5151
};
5252
}
5353
}
@@ -83,8 +83,8 @@ message SynthesizeLongAudioMetadata {
8383
// Time when the request was received.
8484
google.protobuf.Timestamp start_time = 1;
8585

86-
// Time of the most recent processing update.
87-
google.protobuf.Timestamp last_update_time = 2;
86+
// Deprecated. Do not use.
87+
google.protobuf.Timestamp last_update_time = 2 [deprecated = true];
8888

8989
// The progress of the most recent processing update in percentage, ie. 70.0%.
9090
double progress_percentage = 3;

google/cloud/texttospeech/v1beta1/texttospeech_v1beta1.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ apis:
88
- name: google.cloud.texttospeech.v1beta1.TextToSpeechLongAudioSynthesize
99
- name: google.longrunning.Operations
1010

11+
types:
12+
- name: google.cloud.texttospeech.v1beta1.SynthesizeLongAudioMetadata
13+
1114
documentation:
1215
summary: |-
1316
Synthesizes natural-sounding speech by applying powerful neural network
@@ -17,6 +20,13 @@ documentation:
1720
1821
Google Cloud Text-to-Speech API provides speech synthesis as a service.
1922
23+
http:
24+
rules:
25+
- selector: google.longrunning.Operations.GetOperation
26+
get: '/v1beta1/{name=projects/*/locations/*/operations/*}'
27+
- selector: google.longrunning.Operations.ListOperations
28+
get: '/v1beta1/{name=projects/*/locations/*}/operations'
29+
2030
authentication:
2131
rules:
2232
- selector: google.cloud.texttospeech.v1beta1.TextToSpeech.ListVoices

0 commit comments

Comments
 (0)