Skip to content

Commit

Permalink
feat: add LRS API (#3702)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Dec 6, 2022
1 parent 693d417 commit 21dce32
Show file tree
Hide file tree
Showing 18 changed files with 17,181 additions and 9,021 deletions.
1 change: 1 addition & 0 deletions packages/google-cloud-texttospeech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| 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) |
| 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) |
| 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) |
| 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) |
| 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) |
| 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) |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -58,19 +58,6 @@ service TextToSpeech {
}
}

// The top-level message sent by the client for the `ListVoices` method.
message ListVoicesRequest {
// Optional. Recommended.
// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
// If not specified, the API will return all supported voices.
// If specified, the ListVoices call will only return voices that can be used
// to synthesize this language_code. For example, if you specify `"en-NZ"`,
// all `"en-NZ"` voices will be returned. If you specify `"no"`, both
// `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be
// returned.
string language_code = 1 [(google.api.field_behavior) = OPTIONAL];
}

// Gender of the voice as described in
// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).
enum SsmlVoiceGender {
Expand All @@ -94,7 +81,7 @@ enum SsmlVoiceGender {
// Configuration to set up audio encoder. The encoding determines the output
// audio format that we'd like.
enum AudioEncoding {
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
// Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
AUDIO_ENCODING_UNSPECIFIED = 0;

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

// The top-level message sent by the client for the `ListVoices` method.
message ListVoicesRequest {
// Optional. Recommended.
// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
// If not specified, the API will return all supported voices.
// If specified, the ListVoices call will only return voices that can be used
// to synthesize this language_code. For example, if you specify `"en-NZ"`,
// all `"en-NZ"` voices will be returned. If you specify `"no"`, both
// `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be
// returned.
string language_code = 1 [(google.api.field_behavior) = OPTIONAL];
}

// The message returned to the client by the `ListVoices` method.
message ListVoicesResponse {
// The list of voices.
Expand Down Expand Up @@ -171,8 +171,8 @@ message SynthesizeSpeechRequest {

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

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

// Optional. Input only. An identifier which selects 'audio effects' profiles
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.texttospeech.v1beta1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/cloud/texttospeech/v1beta1/cloud_tts.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/timestamp.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.TextToSpeech.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech";
option java_multiple_files = true;
option java_outer_classname = "TextToSpeechLongAudioSynthesisProto";
option java_package = "com.google.cloud.texttospeech.v1beta1";
option php_namespace = "Google\\Cloud\\TextToSpeech\\V1beta1";
option ruby_package = "Google::Cloud::TextToSpeech::V1beta1";

// Service that implements Google Cloud Text-to-Speech API.
service TextToSpeechLongAudioSynthesize {
option (google.api.default_host) = "texttospeech.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Synthesizes long form text asynchronously.
rpc SynthesizeLongAudio(SynthesizeLongAudioRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*/voices/*}:SynthesizeLongAudio"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "SynthesizeLongAudioResponse"
metadata_type: "SynthesizeLongAudioMetadata"
};
}
}

// The top-level message sent by the client for the
// `SynthesizeLongAudio` method.
message SynthesizeLongAudioRequest {
// The resource states of the request in the form of
// projects/*/locations/*/voices/*.
string parent = 1;

// Required. The Synthesizer requires either plain text or SSML as input.
SynthesisInput input = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The configuration of the synthesized audio.
AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED];

// Specifies a Cloud Storage URI for the synthesis results. Must be
// specified in the format: `gs://bucket_name/object_name`, and the bucket
// must already exist.
string output_gcs_uri = 4;

// The desired voice of the synthesized audio.
VoiceSelectionParams voice = 5;
}

// The message returned to the client by the `SynthesizeLongAudio` method.
message SynthesizeLongAudioResponse {}

// Metadata for response returned by the `SynthesizeLongAudio` method.
message SynthesizeLongAudioMetadata {
// Time when the request was received.
google.protobuf.Timestamp start_time = 1;

// Time of the most recent processing update.
google.protobuf.Timestamp last_update_time = 2;

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

0 comments on commit 21dce32

Please sign in to comment.