feat: A new method StreamingSynthesize is added to service TextToSpeech

docs: A comment for field `name` in message `.google.cloud.texttospeech.v1.VoiceSelectionParams` is changed
PiperOrigin-RevId: 662708702
This commit is contained in:
Google APIs 2024-08-13 17:22:24 -07:00 committed by Copybara-Service
parent 83e5198365
commit 569fc73ce3
2 changed files with 55 additions and 7 deletions

View file

@ -27,6 +27,7 @@ option go_package = "cloud.google.com/go/texttospeech/apiv1/texttospeechpb;textt
option java_multiple_files = true;
option java_outer_classname = "TextToSpeechProto";
option java_package = "com.google.cloud.texttospeech.v1";
option objc_class_prefix = "CTTS";
option php_namespace = "Google\\Cloud\\TextToSpeech\\V1";
option ruby_package = "Google::Cloud::TextToSpeech::V1";
option (google.api.resource_definition) = {
@ -58,6 +59,11 @@ service TextToSpeech {
};
option (google.api.method_signature) = "input,voice,audio_config";
}
// Performs bidirectional streaming speech synthesis: receive audio while
// sending text.
rpc StreamingSynthesize(stream StreamingSynthesizeRequest)
returns (stream StreamingSynthesizeResponse) {}
}
// Gender of the voice as described in
@ -191,8 +197,9 @@ message VoiceSelectionParams {
// Bokmal) instead of "no" (Norwegian)".
string language_code = 1 [(google.api.field_behavior) = REQUIRED];
// The name of the voice. If not set, the service will choose a
// voice based on the other parameters such as language_code and gender.
// The name of the voice. If both the name and the gender are not set,
// the service will choose a voice based on the other parameters such as
// language_code.
string name = 2;
// The preferred gender of the voice. If not set, the service will
@ -302,3 +309,48 @@ message SynthesizeSpeechResponse {
// whereas JSON representations use base64.
bytes audio_content = 1;
}
// Provides configuration information for the StreamingSynthesize request.
message StreamingSynthesizeConfig {
// Required. The desired voice of the synthesized audio.
VoiceSelectionParams voice = 1 [(google.api.field_behavior) = REQUIRED];
}
// Input to be synthesized.
message StreamingSynthesisInput {
oneof input_source {
// The raw text to be synthesized. It is recommended that each input
// contains complete, terminating sentences, as this will likely result in
// better prosody in the output audio. That being said, users are free to
// input text however they please.
string text = 1;
}
}
// Request message for the `StreamingSynthesize` method. Multiple
// `StreamingSynthesizeRequest` messages are sent in one call.
// The first message must contain a `streaming_config` that
// fully specifies the request configuration and must not contain `input`. All
// subsequent messages must only have `input` set.
message StreamingSynthesizeRequest {
// The request to be sent, either a StreamingSynthesizeConfig or
// StreamingSynthesisInput.
oneof streaming_request {
// StreamingSynthesizeConfig to be used in this streaming attempt. Only
// specified in the first message sent in a `StreamingSynthesize` call.
StreamingSynthesizeConfig streaming_config = 1;
// Input to synthesize. Specified in all messages but the first in a
// `StreamingSynthesize` call.
StreamingSynthesisInput input = 2;
}
}
// `StreamingSynthesizeResponse` is the only message returned to the
// client by `StreamingSynthesize` method. A series of zero or more
// `StreamingSynthesizeResponse` messages are streamed back to the client.
message StreamingSynthesizeResponse {
// The audio data bytes encoded as specified in the request. This is
// headerless LINEAR16 audio with a sample rate of 24000.
bytes audio_content = 1;
}

View file

@ -29,11 +29,7 @@ http:
authentication:
rules:
- selector: google.cloud.texttospeech.v1.TextToSpeech.ListVoices
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.texttospeech.v1.TextToSpeech.SynthesizeSpeech
- selector: 'google.cloud.texttospeech.v1.TextToSpeech.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform