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.
3838service 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.
8385enum 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.
176179message 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.
191195message 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.
279283message 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.
0 commit comments