diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py b/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py index 97736e3a0080..3ac941cd65d6 100644 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py +++ b/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py @@ -28,7 +28,7 @@ class AudioEncoding(enum.IntEnum): AUDIO_ENCODING_UNSPECIFIED (int): Not specified. Will return result ``google.rpc.Code.INVALID_ARGUMENT``. LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content returned as LINEAR16 also contains a WAV header. - MP3 (int): MP3 audio. + MP3 (int): MP3 audio at 32kbps. OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a file which can be played natively on Android, and in browsers (at least Chrome and Firefox). The quality of the encoding is considerably higher diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py b/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py index 658ac0ec72d1..868398f228ae 100644 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py +++ b/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py @@ -200,7 +200,7 @@ def list_voices( >>> response = client.list_voices() Args: - language_code (str): Optional (but recommended) + language_code (str): Optional. Recommended. `BCP-47 `__ language tag. If specified, the ListVoices call will only return voices that can be used to synthesize this language\_code. E.g. when specifying "en-NZ", diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py b/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py index 91bb80823f63..5c86cb227911 100644 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py +++ b/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py @@ -18,13 +18,13 @@ }, "methods": { "ListVoices": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "SynthesizeSpeech": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, }, diff --git a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto index dd9fa6ce221a..6263da4ab085 100644 --- a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto +++ b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ syntax = "proto3"; package google.cloud.texttospeech.v1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.TextToSpeech.V1"; @@ -29,27 +31,31 @@ option php_namespace = "Google\\Cloud\\TextToSpeech\\V1"; // Service that implements Google Cloud Text-to-Speech API. service TextToSpeech { + option (google.api.default_host) = "texttospeech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + // Returns a list of Voice supported for synthesis. rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { option (google.api.http) = { get: "/v1/voices" }; + option (google.api.method_signature) = "language_code"; } // Synthesizes speech synchronously: receive results after all text input // has been processed. - rpc SynthesizeSpeech(SynthesizeSpeechRequest) - returns (SynthesizeSpeechResponse) { + rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { option (google.api.http) = { post: "/v1/text:synthesize" body: "*" }; + option (google.api.method_signature) = "input,voice,audio_config"; } } // The top-level message sent by the client for the `ListVoices` method. message ListVoicesRequest { - // Optional (but recommended) + // Optional. Recommended. // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If // specified, the ListVoices call will only return voices that can be used to // synthesize this language_code. E.g. when specifying "en-NZ", you will get @@ -57,7 +63,47 @@ message ListVoicesRequest { // "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" // will also get supported "cmn-*" voices; specifying "zh-hk" will also get // supported "yue-*" voices. - string language_code = 1; + 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 { + // An unspecified gender. + // In VoiceSelectionParams, this means that the client doesn't care which + // gender the selected voice will have. In the Voice field of + // ListVoicesResponse, this may mean that the voice doesn't fit any of the + // other categories in this enum, or that the gender of the voice isn't known. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + MALE = 1; + + // A female voice. + FEMALE = 2; + + // A gender-neutral voice. + NEUTRAL = 3; +} + +// 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][]. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + LINEAR16 = 1; + + // MP3 audio at 32kbps. + MP3 = 2; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OGG_OPUS = 3; } // The message returned to the client by the `ListVoices` method. @@ -86,13 +132,13 @@ message Voice { // The top-level message sent by the client for the `SynthesizeSpeech` method. message SynthesizeSpeechRequest { // Required. The Synthesizer requires either plain text or SSML as input. - SynthesisInput input = 1; + SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The desired voice of the synthesized audio. - VoiceSelectionParams voice = 2; + VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The configuration of the synthesized audio. - AudioConfig audio_config = 3; + AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; } // Contains text input to be synthesized. Either `text` or `ssml` must be @@ -115,9 +161,9 @@ message SynthesisInput { // Description of which voice to use for a synthesis request. message VoiceSelectionParams { - // The language (and optionally also the region) of the voice expressed as a + // Required. The language (and potentially also the region) of the voice expressed as a // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - // "en-US". Required. This should not include a script tag (e.g. use + // "en-US". This should not include a script tag (e.g. use // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred // from the input provided in the SynthesisInput. The TTS service // will use this parameter to help choose an appropriate voice. Note that @@ -126,13 +172,13 @@ message VoiceSelectionParams { // (e.g. using en-US rather than en-CA if there isn't a Canadian voice // available), or even a different language, e.g. using "nb" (Norwegian // Bokmal) instead of "no" (Norwegian)". - string language_code = 1; + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - // The name of the voice. Optional; if not set, the service will choose a + // 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. string name = 2; - // The preferred gender of the voice. Optional; if not set, the service will + // The preferred gender of the voice. If not set, the service will // choose a voice based on the other parameters such as language_code and // name. Note that this is only a preference, not requirement; if a // voice of the appropriate gender is not available, the synthesizer should @@ -142,94 +188,66 @@ message VoiceSelectionParams { // Description of audio data to be synthesized. message AudioConfig { - // Required. The format of the requested audio byte stream. - AudioEncoding audio_encoding = 1; - - // Optional speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - // native speed supported by the specific voice. 2.0 is twice as fast, and - // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any - // other values < 0.25 or > 4.0 will return an error. - double speaking_rate = 2; - - // Optional speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - // semitones from the original pitch. -20 means decrease 20 semitones from the - // original pitch. - double pitch = 3; - - // Optional volume gain (in dB) of the normal native volume supported by the - // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - // will play at approximately half the amplitude of the normal native signal - // amplitude. A value of +6.0 (dB) will play at approximately twice the - // amplitude of the normal native signal amplitude. Strongly recommend not to - // exceed +10 (dB) as there's usually no effective increase in loudness for - // any value greater than that. - double volume_gain_db = 4; - - // The synthesis sample rate (in hertz) for this audio. Optional. If this is - // different from the voice's natural sample rate, then the synthesizer will - // honor this request by 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][]. - int32 sample_rate_hertz = 5; - - // An identifier which selects 'audio effects' profiles that are applied on - // (post synthesized) text to speech. - // Effects are applied on top of each other in the order they are given. - // See - // - // [audio-profiles](https: - // //cloud.google.com/text-to-speech/docs/audio-profiles) - // for current supported profile ids. - repeated string effects_profile_id = 6; + // Required. The format of the audio byte stream. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is + // the normal native speed supported by the specific voice. 2.0 is twice as + // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + // speed. Any other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 2 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + // increase 20 semitones from the original pitch. -20 means decrease 20 + // semitones from the original pitch. + double pitch = 3 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Volume gain (in dB) of the normal native volume + // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + // set to a value of 0.0 (dB), will play at normal native signal amplitude. A + // value of -6.0 (dB) will play at approximately half the amplitude of the + // normal native signal amplitude. A value of +6.0 (dB) will play at + // approximately twice the amplitude of the normal native signal amplitude. + // Strongly recommend not to exceed +10 (dB) as there's usually no effective + // increase in loudness for any value greater than that. + double volume_gain_db = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The synthesis sample rate (in hertz) for this audio. When this is + // specified in SynthesizeSpeechRequest, if this is different from the voice's + // natural sample rate, then the synthesizer will honor this request by + // 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][]. + int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. An identifier which selects 'audio effects' profiles + // that are applied on (post synthesized) text to speech. Effects are applied + // on top of each other in the order they are given. See + // [audio + // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + // current supported profile ids. + repeated string effects_profile_id = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; } // The message returned to the client by the `SynthesizeSpeech` method. message SynthesizeSpeechResponse { // The audio data bytes encoded as specified in the request, including the - // header (For LINEAR16 audio, we include the WAV header). Note: as + // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + // For LINEAR16 audio, we include the WAV header. Note: as // with all bytes fields, protobuffers use a pure binary representation, // whereas JSON representations use base64. bytes audio_content = 1; } - -// Gender of the voice as described in -// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). -enum SsmlVoiceGender { - // An unspecified gender. - // In VoiceSelectionParams, this means that the client doesn't care which - // gender the selected voice will have. In the Voice field of - // ListVoicesResponse, this may mean that the voice doesn't fit any of the - // other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0; - - // A male voice. - MALE = 1; - - // A female voice. - FEMALE = 2; - - // A gender-neutral voice. - NEUTRAL = 3; -} - -// 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][]. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1; - - // MP3 audio. - MP3 = 2; - - // Opus encoded audio wrapped in an ogg container. The result will be a - // file which can be played natively on Android, and in browsers (at least - // Chrome and Firefox). The quality of the encoding is considerably higher - // than MP3 while using approximately the same bitrate. - OGG_OPUS = 3; -} diff --git a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py index 1c8e163d5dc0..24af440d65b6 100644 --- a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py +++ b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py @@ -17,6 +17,8 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -27,9 +29,13 @@ "\n com.google.cloud.texttospeech.v1B\021TextToSpeechProtoP\001ZHgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech\370\001\001\252\002\034Google.Cloud.TextToSpeech.V1\312\002\034Google\\Cloud\\TextToSpeech\\V1" ), serialized_pb=_b( - '\n2google/cloud/texttospeech_v1/proto/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto"*\n\x11ListVoicesRequest\x12\x15\n\rlanguage_code\x18\x01 \x01(\t"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05"\xda\x01\n\x17SynthesizeSpeechRequest\x12;\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInput\x12\x41\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParams\x12?\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfig"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source"\x7f\n\x14VoiceSelectionParams\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender"\xc7\x01\n\x0b\x41udioConfig\x12\x43\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncoding\x12\x15\n\rspeaking_rate\x18\x02 \x01(\x01\x12\r\n\x05pitch\x18\x03 \x01(\x01\x12\x16\n\x0evolume_gain_db\x18\x04 \x01(\x01\x12\x19\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x12\x1a\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\t"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*T\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x32\xb8\x02\n\x0cTextToSpeech\x12\x83\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse"\x12\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\x12\xa1\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse"\x1e\x82\xd3\xe4\x93\x02\x18"\x13/v1/text:synthesize:\x01*B\xc2\x01\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZHgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1b\x06proto3' + '\n2google/cloud/texttospeech_v1/proto/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05"\xe9\x01\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source"\x84\x01\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender"\xf1\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*T\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x32\xb4\x03\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse""\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\xda\x41\rlanguage_code\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse"9\x82\xd3\xe4\x93\x02\x18"\x13/v1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc2\x01\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZHgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1b\x06proto3' ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + ], ) _SSMLVOICEGENDER = _descriptor.EnumDescriptor( @@ -57,8 +63,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1053, - serialized_end=1140, + serialized_start=1179, + serialized_end=1266, ) _sym_db.RegisterEnumDescriptor(_SSMLVOICEGENDER) @@ -88,8 +94,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1142, - serialized_end=1226, + serialized_start=1268, + serialized_end=1352, ) _sym_db.RegisterEnumDescriptor(_AUDIOENCODING) @@ -126,7 +132,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ) ], @@ -138,8 +144,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=114, - serialized_end=156, + serialized_start=172, + serialized_end=219, ) @@ -177,8 +183,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=158, - serialized_end=231, + serialized_start=221, + serialized_end=294, ) @@ -270,8 +276,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=234, - serialized_end=382, + serialized_start=297, + serialized_end=445, ) @@ -297,7 +303,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -315,7 +321,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -333,7 +339,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), ], @@ -345,8 +351,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=385, - serialized_end=603, + serialized_start=448, + serialized_end=681, ) @@ -410,8 +416,8 @@ fields=[], ) ], - serialized_start=605, - serialized_end=669, + serialized_start=683, + serialized_end=747, ) @@ -437,7 +443,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -485,8 +491,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=671, - serialized_end=798, + serialized_start=750, + serialized_end=882, ) @@ -512,7 +518,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -530,7 +536,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -548,7 +554,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -566,7 +572,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -584,7 +590,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -602,7 +608,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), ], @@ -614,8 +620,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=801, - serialized_end=1000, + serialized_start=885, + serialized_end=1126, ) @@ -653,8 +659,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1002, - serialized_end=1051, + serialized_start=1128, + serialized_end=1177, ) _LISTVOICESRESPONSE.fields_by_name["voices"].message_type = _VOICE @@ -699,7 +705,7 @@ Attributes: language_code: - Optional (but recommended) `BCP-47 `__ language tag. If specified, the ListVoices call will only return voices that can be used to synthesize this language\_code. E.g. when specifying "en- @@ -821,30 +827,30 @@ Attributes: language_code: - The language (and optionally also the region) of the voice - expressed as a `BCP-47 `__ language tag, e.g. "en-US". - Required. This should not include a script tag (e.g. use "cmn- - cn" rather than "cmn-Hant-cn"), because the script will be - inferred from the input provided in the SynthesisInput. The - TTS service will use this parameter to help choose an - appropriate voice. Note that the TTS service may choose a - voice with a slightly different language code than the one - selected; it may substitute a different region (e.g. using en- - US rather than en-CA if there isn't a Canadian voice - available), or even a different language, e.g. using "nb" - (Norwegian Bokmal) instead of "no" (Norwegian)". + This should not include a script tag (e.g. use "cmn-cn" rather + than "cmn-Hant-cn"), because the script will be inferred from + the input provided in the SynthesisInput. The TTS service will + use this parameter to help choose an appropriate voice. Note + that the TTS service may choose a voice with a slightly + different language code than the one selected; it may + substitute a different region (e.g. using en-US rather than + en-CA if there isn't a Canadian voice available), or even a + different language, e.g. using "nb" (Norwegian Bokmal) instead + of "no" (Norwegian)". name: - The name of the voice. Optional; 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 not set, the service will choose a + voice based on the other parameters such as language\_code and + gender. ssml_gender: - The preferred gender of the voice. Optional; if not set, the - service will choose a voice based on the other parameters such - as language\_code and name. Note that this is only a - preference, not requirement; if a voice of the appropriate - gender is not available, the synthesizer should substitute a - voice with a different gender rather than failing the request. + The preferred gender of the voice. If not set, the service + will choose a voice based on the other parameters such as + language\_code and name. Note that this is only a preference, + not requirement; if a voice of the appropriate gender is not + available, the synthesizer should substitute a voice with a + different gender rather than failing the request. """, # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.VoiceSelectionParams) ), @@ -862,43 +868,44 @@ Attributes: audio_encoding: - Required. The format of the requested audio byte stream. + Required. The format of the audio byte stream. speaking_rate: - Optional speaking rate/speed, in the range [0.25, 4.0]. 1.0 is - the normal native speed supported by the specific voice. 2.0 - is twice as fast, and 0.5 is half as fast. If unset(0.0), - defaults to the native 1.0 speed. Any other values < 0.25 or > - 4.0 will return an error. + Optional. Input only. Speaking rate/speed, in the range [0.25, + 4.0]. 1.0 is the normal native speed supported by the specific + voice. 2.0 is twice as fast, and 0.5 is half as fast. If + unset(0.0), defaults to the native 1.0 speed. Any other values + < 0.25 or > 4.0 will return an error. pitch: - Optional speaking pitch, in the range [-20.0, 20.0]. 20 means - increase 20 semitones from the original pitch. -20 means - decrease 20 semitones from the original pitch. + Optional. Input only. Speaking pitch, in the range [-20.0, + 20.0]. 20 means increase 20 semitones from the original pitch. + -20 means decrease 20 semitones from the original pitch. volume_gain_db: - Optional volume gain (in dB) of the normal native volume - supported by the specific voice, in the range [-96.0, 16.0]. - If unset, or set to a value of 0.0 (dB), will play at normal - native signal amplitude. A value of -6.0 (dB) will play at - approximately half the amplitude of the normal native signal - amplitude. A value of +6.0 (dB) will play at approximately - twice the amplitude of the normal native signal amplitude. - Strongly recommend not to exceed +10 (dB) as there's usually - no effective increase in loudness for any value greater than - that. + Optional. Input only. Volume gain (in dB) of the normal native + volume supported by the specific voice, in the range [-96.0, + 16.0]. If unset, or set to a value of 0.0 (dB), will play at + normal native signal amplitude. A value of -6.0 (dB) will play + at approximately half the amplitude of the normal native + signal amplitude. A value of +6.0 (dB) will play at + approximately twice the amplitude of the normal native signal + amplitude. Strongly recommend not to exceed +10 (dB) as + there's usually no effective increase in loudness for any + value greater than that. sample_rate_hertz: - The synthesis sample rate (in hertz) for this audio. Optional. - If this is different from the voice's natural sample rate, - then the synthesizer will honor this request by converting to - the desired sample rate (which might result in worse audio + Optional. The synthesis sample rate (in hertz) for this audio. + When this is specified in SynthesizeSpeechRequest, if this is + different from the voice's natural sample rate, then the + synthesizer will honor this request by 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][]. effects_profile_id: - An identifier which selects 'audio effects' profiles that are - applied on (post synthesized) text to speech. Effects are - applied on top of each other in the order they are given. See - `audio-profiles `__ for current supported profile - ids. + Optional. Input only. An identifier which selects 'audio + effects' profiles that are applied on (post synthesized) text + to speech. Effects are applied on top of each other in the + order they are given. See `audio profiles + `__ for current supported profile ids. """, # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.AudioConfig) ), @@ -917,10 +924,11 @@ Attributes: audio_content: The audio data bytes encoded as specified in the request, - including the header (For LINEAR16 audio, we include the WAV - header). Note: as with all bytes fields, protobuffers use a - pure binary representation, whereas JSON representations use - base64. + including the header for encodings that are wrapped in + containers (e.g. MP3, OGG\_OPUS). For LINEAR16 audio, we + include the WAV header. Note: as with all bytes fields, + protobuffers use a pure binary representation, whereas JSON + representations use base64. """, # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.SynthesizeSpeechResponse) ), @@ -929,15 +937,28 @@ DESCRIPTOR._options = None +_LISTVOICESREQUEST.fields_by_name["language_code"]._options = None +_SYNTHESIZESPEECHREQUEST.fields_by_name["input"]._options = None +_SYNTHESIZESPEECHREQUEST.fields_by_name["voice"]._options = None +_SYNTHESIZESPEECHREQUEST.fields_by_name["audio_config"]._options = None +_VOICESELECTIONPARAMS.fields_by_name["language_code"]._options = None +_AUDIOCONFIG.fields_by_name["audio_encoding"]._options = None +_AUDIOCONFIG.fields_by_name["speaking_rate"]._options = None +_AUDIOCONFIG.fields_by_name["pitch"]._options = None +_AUDIOCONFIG.fields_by_name["volume_gain_db"]._options = None +_AUDIOCONFIG.fields_by_name["sample_rate_hertz"]._options = None +_AUDIOCONFIG.fields_by_name["effects_profile_id"]._options = None _TEXTTOSPEECH = _descriptor.ServiceDescriptor( name="TextToSpeech", full_name="google.cloud.texttospeech.v1.TextToSpeech", file=DESCRIPTOR, index=0, - serialized_options=None, - serialized_start=1229, - serialized_end=1541, + serialized_options=_b( + "\312A\033texttospeech.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" + ), + serialized_start=1355, + serialized_end=1791, methods=[ _descriptor.MethodDescriptor( name="ListVoices", @@ -946,7 +967,9 @@ containing_service=None, input_type=_LISTVOICESREQUEST, output_type=_LISTVOICESRESPONSE, - serialized_options=_b("\202\323\344\223\002\014\022\n/v1/voices"), + serialized_options=_b( + "\202\323\344\223\002\014\022\n/v1/voices\332A\rlanguage_code" + ), ), _descriptor.MethodDescriptor( name="SynthesizeSpeech", @@ -956,7 +979,7 @@ input_type=_SYNTHESIZESPEECHREQUEST, output_type=_SYNTHESIZESPEECHRESPONSE, serialized_options=_b( - '\202\323\344\223\002\030"\023/v1/text:synthesize:\001*' + '\202\323\344\223\002\030"\023/v1/text:synthesize:\001*\332A\030input,voice,audio_config' ), ), ], diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py index 97736e3a0080..3ac941cd65d6 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py +++ b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py @@ -28,7 +28,7 @@ class AudioEncoding(enum.IntEnum): AUDIO_ENCODING_UNSPECIFIED (int): Not specified. Will return result ``google.rpc.Code.INVALID_ARGUMENT``. LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content returned as LINEAR16 also contains a WAV header. - MP3 (int): MP3 audio. + MP3 (int): MP3 audio at 32kbps. OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a file which can be played natively on Android, and in browsers (at least Chrome and Firefox). The quality of the encoding is considerably higher diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py index cf7b3e47dfe7..dcafa0fad9be 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py +++ b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py @@ -192,7 +192,7 @@ def list_voices( metadata=None, ): """ - Returns a list of ``Voice`` supported for synthesis. + Returns a list of Voice supported for synthesis. Example: >>> from google.cloud import texttospeech_v1beta1 @@ -202,7 +202,7 @@ def list_voices( >>> response = client.list_voices() Args: - language_code (str): Optional (but recommended) + language_code (str): Optional. Recommended. `BCP-47 `__ language tag. If specified, the ListVoices call will only return voices that can be used to synthesize this language\_code. E.g. when specifying "en-NZ", diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py index bec87d4bd398..0463d0e9e778 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py +++ b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py @@ -18,13 +18,13 @@ }, "methods": { "ListVoices": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "SynthesizeSpeech": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, }, diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py index f2c95085735d..80b403a14bf8 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py +++ b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py @@ -111,7 +111,7 @@ def channel(self): def list_voices(self): """Return the gRPC stub for :meth:`TextToSpeechClient.list_voices`. - Returns a list of ``Voice`` supported for synthesis. + Returns a list of Voice supported for synthesis. Returns: Callable: A callable which accepts the appropriate diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto index 791499c4dda0..443ff6d56f61 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto +++ b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,43 +11,51 @@ // 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"; 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 = "TextToSpeechProto"; option java_package = "com.google.cloud.texttospeech.v1beta1"; +option php_namespace = "Google\\Cloud\\TextToSpeech\\V1beta1"; // Service that implements Google Cloud Text-to-Speech API. service TextToSpeech { - // Returns a list of [Voice][google.cloud.texttospeech.v1beta1.Voice] - // supported for synthesis. + option (google.api.default_host) = "texttospeech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of Voice supported for synthesis. rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { option (google.api.http) = { get: "/v1beta1/voices" }; + option (google.api.method_signature) = "language_code"; } // Synthesizes speech synchronously: receive results after all text input // has been processed. - rpc SynthesizeSpeech(SynthesizeSpeechRequest) - returns (SynthesizeSpeechResponse) { + rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { option (google.api.http) = { post: "/v1beta1/text:synthesize" body: "*" }; + option (google.api.method_signature) = "input,voice,audio_config"; } } // The top-level message sent by the client for the `ListVoices` method. message ListVoicesRequest { - // Optional (but recommended) + // Optional. Recommended. // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If // specified, the ListVoices call will only return voices that can be used to // synthesize this language_code. E.g. when specifying "en-NZ", you will get @@ -55,7 +63,47 @@ message ListVoicesRequest { // "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" // will also get supported "cmn-*" voices; specifying "zh-hk" will also get // supported "yue-*" voices. - string language_code = 1; + 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 { + // An unspecified gender. + // In VoiceSelectionParams, this means that the client doesn't care which + // gender the selected voice will have. In the Voice field of + // ListVoicesResponse, this may mean that the voice doesn't fit any of the + // other categories in this enum, or that the gender of the voice isn't known. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + MALE = 1; + + // A female voice. + FEMALE = 2; + + // A gender-neutral voice. + NEUTRAL = 3; +} + +// 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][]. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + LINEAR16 = 1; + + // MP3 audio at 32kbps. + MP3 = 2; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OGG_OPUS = 3; } // The message returned to the client by the `ListVoices` method. @@ -84,13 +132,13 @@ message Voice { // The top-level message sent by the client for the `SynthesizeSpeech` method. message SynthesizeSpeechRequest { // Required. The Synthesizer requires either plain text or SSML as input. - SynthesisInput input = 1; + SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The desired voice of the synthesized audio. - VoiceSelectionParams voice = 2; + VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The configuration of the synthesized audio. - AudioConfig audio_config = 3; + AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; } // Contains text input to be synthesized. Either `text` or `ssml` must be @@ -113,9 +161,9 @@ message SynthesisInput { // Description of which voice to use for a synthesis request. message VoiceSelectionParams { - // The language (and optionally also the region) of the voice expressed as a + // Required. The language (and potentially also the region) of the voice expressed as a // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - // "en-US". Required. This should not include a script tag (e.g. use + // "en-US". This should not include a script tag (e.g. use // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred // from the input provided in the SynthesisInput. The TTS service // will use this parameter to help choose an appropriate voice. Note that @@ -124,13 +172,13 @@ message VoiceSelectionParams { // (e.g. using en-US rather than en-CA if there isn't a Canadian voice // available), or even a different language, e.g. using "nb" (Norwegian // Bokmal) instead of "no" (Norwegian)". - string language_code = 1; + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - // The name of the voice. Optional; if not set, the service will choose a + // 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. string name = 2; - // The preferred gender of the voice. Optional; if not set, the service will + // The preferred gender of the voice. If not set, the service will // choose a voice based on the other parameters such as language_code and // name. Note that this is only a preference, not requirement; if a // voice of the appropriate gender is not available, the synthesizer should @@ -140,89 +188,66 @@ message VoiceSelectionParams { // Description of audio data to be synthesized. message AudioConfig { - // Required. The format of the requested audio byte stream. - AudioEncoding audio_encoding = 1; - - // Optional speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - // native speed supported by the specific voice. 2.0 is twice as fast, and - // 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any - // other values < 0.25 or > 4.0 will return an error. - double speaking_rate = 2; - - // Optional speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - // semitones from the original pitch. -20 means decrease 20 semitones from the - // original pitch. - double pitch = 3; - - // Optional volume gain (in dB) of the normal native volume supported by the - // specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - // 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - // will play at approximately half the amplitude of the normal native signal - // amplitude. A value of +6.0 (dB) will play at approximately twice the - // amplitude of the normal native signal amplitude. Strongly recommend not to - // exceed +10 (dB) as there's usually no effective increase in loudness for - // any value greater than that. - double volume_gain_db = 4; - - // The synthesis sample rate (in hertz) for this audio. Optional. If this is - // different from the voice's natural sample rate, then the synthesizer will - // honor this request by 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][]. - int32 sample_rate_hertz = 5; - - // An identifier which selects 'audio effects' profiles that are applied on - // (post synthesized) text to speech. - // Effects are applied on top of each other in the order they are given. - repeated string effects_profile_id = 6; + // Required. The format of the audio byte stream. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is + // the normal native speed supported by the specific voice. 2.0 is twice as + // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + // speed. Any other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 2 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + // increase 20 semitones from the original pitch. -20 means decrease 20 + // semitones from the original pitch. + double pitch = 3 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Volume gain (in dB) of the normal native volume + // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + // set to a value of 0.0 (dB), will play at normal native signal amplitude. A + // value of -6.0 (dB) will play at approximately half the amplitude of the + // normal native signal amplitude. A value of +6.0 (dB) will play at + // approximately twice the amplitude of the normal native signal amplitude. + // Strongly recommend not to exceed +10 (dB) as there's usually no effective + // increase in loudness for any value greater than that. + double volume_gain_db = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The synthesis sample rate (in hertz) for this audio. When this is + // specified in SynthesizeSpeechRequest, if this is different from the voice's + // natural sample rate, then the synthesizer will honor this request by + // 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][]. + int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. An identifier which selects 'audio effects' profiles + // that are applied on (post synthesized) text to speech. Effects are applied + // on top of each other in the order they are given. See + // [audio + // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + // current supported profile ids. + repeated string effects_profile_id = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; } // The message returned to the client by the `SynthesizeSpeech` method. message SynthesizeSpeechResponse { // The audio data bytes encoded as specified in the request, including the - // header (For LINEAR16 audio, we include the WAV header). Note: as + // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + // For LINEAR16 audio, we include the WAV header. Note: as // with all bytes fields, protobuffers use a pure binary representation, // whereas JSON representations use base64. bytes audio_content = 1; } - -// Gender of the voice as described in -// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). -enum SsmlVoiceGender { - // An unspecified gender. - // In VoiceSelectionParams, this means that the client doesn't care which - // gender the selected voice will have. In the Voice field of - // ListVoicesResponse, this may mean that the voice doesn't fit any of the - // other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0; - - // A male voice. - MALE = 1; - - // A female voice. - FEMALE = 2; - - // A gender-neutral voice. - NEUTRAL = 3; -} - -// 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][]. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1; - - // MP3 audio. - MP3 = 2; - - // Opus encoded audio wrapped in an ogg container. The result will be a - // file which can be played natively on Android, and in browsers (at least - // Chrome and Firefox). The quality of the encoding is considerably higher - // than MP3 while using approximately the same bitrate. - OGG_OPUS = 3; -} diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py index 11080df95fbd..17dc91768978 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py +++ b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py @@ -17,6 +17,8 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -24,12 +26,16 @@ package="google.cloud.texttospeech.v1beta1", syntax="proto3", serialized_options=_b( - "\n%com.google.cloud.texttospeech.v1beta1B\021TextToSpeechProtoP\001ZMgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech\370\001\001" + "\n%com.google.cloud.texttospeech.v1beta1B\021TextToSpeechProtoP\001ZMgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech\370\001\001\252\002!Google.Cloud.TextToSpeech.V1beta1\312\002!Google\\Cloud\\TextToSpeech\\V1beta1" ), serialized_pb=_b( - '\n7google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto\x12!google.cloud.texttospeech.v1beta1\x1a\x1cgoogle/api/annotations.proto"*\n\x11ListVoicesRequest\x12\x15\n\rlanguage_code\x18\x01 \x01(\t"N\n\x12ListVoicesResponse\x12\x38\n\x06voices\x18\x01 \x03(\x0b\x32(.google.cloud.texttospeech.v1beta1.Voice"\x99\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05"\xe9\x01\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInput\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParams\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfig"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source"\x84\x01\n\x14VoiceSelectionParams\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender"\xcc\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncoding\x12\x15\n\rspeaking_rate\x18\x02 \x01(\x01\x12\r\n\x05pitch\x18\x03 \x01(\x01\x12\x16\n\x0evolume_gain_db\x18\x04 \x01(\x01\x12\x19\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x12\x1a\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\t"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*T\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x32\xd6\x02\n\x0cTextToSpeech\x12\x92\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\x12\xb0\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse"#\x82\xd3\xe4\x93\x02\x1d"\x18/v1beta1/text:synthesize:\x01*B\x8e\x01\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZMgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech\xf8\x01\x01\x62\x06proto3' + '\n7google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto\x12!google.cloud.texttospeech.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01"N\n\x12ListVoicesResponse\x12\x38\n\x06voices\x18\x01 \x03(\x0b\x32(.google.cloud.texttospeech.v1beta1.Voice"\x99\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05"\xf8\x01\n\x17SynthesizeSpeechRequest\x12\x45\n\x05input\x18\x01 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInputB\x03\xe0\x41\x02\x12K\n\x05voice\x18\x02 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12I\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfigB\x03\xe0\x41\x02"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source"\x89\x01\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender"\xf6\x01\n\x0b\x41udioConfig\x12M\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*T\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x32\xd2\x03\n\x0cTextToSpeech\x12\xa2\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse"\'\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\xda\x41\rlanguage_code\x12\xcb\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse">\x82\xd3\xe4\x93\x02\x1d"\x18/v1beta1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd6\x01\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZMgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech\xf8\x01\x01\xaa\x02!Google.Cloud.TextToSpeech.V1beta1\xca\x02!Google\\Cloud\\TextToSpeech\\V1beta1b\x06proto3' ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + ], ) _SSMLVOICEGENDER = _descriptor.EnumDescriptor( @@ -57,8 +63,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1099, - serialized_end=1186, + serialized_start=1224, + serialized_end=1311, ) _sym_db.RegisterEnumDescriptor(_SSMLVOICEGENDER) @@ -88,8 +94,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1188, - serialized_end=1272, + serialized_start=1313, + serialized_end=1397, ) _sym_db.RegisterEnumDescriptor(_AUDIOENCODING) @@ -126,7 +132,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ) ], @@ -138,8 +144,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=124, - serialized_end=166, + serialized_start=182, + serialized_end=229, ) @@ -177,8 +183,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=168, - serialized_end=246, + serialized_start=231, + serialized_end=309, ) @@ -270,8 +276,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=249, - serialized_end=402, + serialized_start=312, + serialized_end=465, ) @@ -297,7 +303,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -315,7 +321,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -333,7 +339,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), ], @@ -345,8 +351,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=405, - serialized_end=638, + serialized_start=468, + serialized_end=716, ) @@ -410,8 +416,8 @@ fields=[], ) ], - serialized_start=640, - serialized_end=704, + serialized_start=718, + serialized_end=782, ) @@ -437,7 +443,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -485,8 +491,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=707, - serialized_end=839, + serialized_start=785, + serialized_end=922, ) @@ -512,7 +518,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -530,7 +536,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -548,7 +554,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -566,7 +572,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -584,7 +590,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -602,7 +608,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\004\340A\001"), file=DESCRIPTOR, ), ], @@ -614,8 +620,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=842, - serialized_end=1046, + serialized_start=925, + serialized_end=1171, ) @@ -653,8 +659,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1048, - serialized_end=1097, + serialized_start=1173, + serialized_end=1222, ) _LISTVOICESRESPONSE.fields_by_name["voices"].message_type = _VOICE @@ -699,7 +705,7 @@ Attributes: language_code: - Optional (but recommended) `BCP-47 `__ language tag. If specified, the ListVoices call will only return voices that can be used to synthesize this language\_code. E.g. when specifying "en- @@ -821,30 +827,30 @@ Attributes: language_code: - The language (and optionally also the region) of the voice - expressed as a `BCP-47 `__ language tag, e.g. "en-US". - Required. This should not include a script tag (e.g. use "cmn- - cn" rather than "cmn-Hant-cn"), because the script will be - inferred from the input provided in the SynthesisInput. The - TTS service will use this parameter to help choose an - appropriate voice. Note that the TTS service may choose a - voice with a slightly different language code than the one - selected; it may substitute a different region (e.g. using en- - US rather than en-CA if there isn't a Canadian voice - available), or even a different language, e.g. using "nb" - (Norwegian Bokmal) instead of "no" (Norwegian)". + This should not include a script tag (e.g. use "cmn-cn" rather + than "cmn-Hant-cn"), because the script will be inferred from + the input provided in the SynthesisInput. The TTS service will + use this parameter to help choose an appropriate voice. Note + that the TTS service may choose a voice with a slightly + different language code than the one selected; it may + substitute a different region (e.g. using en-US rather than + en-CA if there isn't a Canadian voice available), or even a + different language, e.g. using "nb" (Norwegian Bokmal) instead + of "no" (Norwegian)". name: - The name of the voice. Optional; 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 not set, the service will choose a + voice based on the other parameters such as language\_code and + gender. ssml_gender: - The preferred gender of the voice. Optional; if not set, the - service will choose a voice based on the other parameters such - as language\_code and name. Note that this is only a - preference, not requirement; if a voice of the appropriate - gender is not available, the synthesizer should substitute a - voice with a different gender rather than failing the request. + The preferred gender of the voice. If not set, the service + will choose a voice based on the other parameters such as + language\_code and name. Note that this is only a preference, + not requirement; if a voice of the appropriate gender is not + available, the synthesizer should substitute a voice with a + different gender rather than failing the request. """, # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.VoiceSelectionParams) ), @@ -862,40 +868,44 @@ Attributes: audio_encoding: - Required. The format of the requested audio byte stream. + Required. The format of the audio byte stream. speaking_rate: - Optional speaking rate/speed, in the range [0.25, 4.0]. 1.0 is - the normal native speed supported by the specific voice. 2.0 - is twice as fast, and 0.5 is half as fast. If unset(0.0), - defaults to the native 1.0 speed. Any other values < 0.25 or > - 4.0 will return an error. + Optional. Input only. Speaking rate/speed, in the range [0.25, + 4.0]. 1.0 is the normal native speed supported by the specific + voice. 2.0 is twice as fast, and 0.5 is half as fast. If + unset(0.0), defaults to the native 1.0 speed. Any other values + < 0.25 or > 4.0 will return an error. pitch: - Optional speaking pitch, in the range [-20.0, 20.0]. 20 means - increase 20 semitones from the original pitch. -20 means - decrease 20 semitones from the original pitch. + Optional. Input only. Speaking pitch, in the range [-20.0, + 20.0]. 20 means increase 20 semitones from the original pitch. + -20 means decrease 20 semitones from the original pitch. volume_gain_db: - Optional volume gain (in dB) of the normal native volume - supported by the specific voice, in the range [-96.0, 16.0]. - If unset, or set to a value of 0.0 (dB), will play at normal - native signal amplitude. A value of -6.0 (dB) will play at - approximately half the amplitude of the normal native signal - amplitude. A value of +6.0 (dB) will play at approximately - twice the amplitude of the normal native signal amplitude. - Strongly recommend not to exceed +10 (dB) as there's usually - no effective increase in loudness for any value greater than - that. + Optional. Input only. Volume gain (in dB) of the normal native + volume supported by the specific voice, in the range [-96.0, + 16.0]. If unset, or set to a value of 0.0 (dB), will play at + normal native signal amplitude. A value of -6.0 (dB) will play + at approximately half the amplitude of the normal native + signal amplitude. A value of +6.0 (dB) will play at + approximately twice the amplitude of the normal native signal + amplitude. Strongly recommend not to exceed +10 (dB) as + there's usually no effective increase in loudness for any + value greater than that. sample_rate_hertz: - The synthesis sample rate (in hertz) for this audio. Optional. - If this is different from the voice's natural sample rate, - then the synthesizer will honor this request by converting to - the desired sample rate (which might result in worse audio + Optional. The synthesis sample rate (in hertz) for this audio. + When this is specified in SynthesizeSpeechRequest, if this is + different from the voice's natural sample rate, then the + synthesizer will honor this request by 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][]. effects_profile_id: - An identifier which selects 'audio effects' profiles that are - applied on (post synthesized) text to speech. Effects are - applied on top of each other in the order they are given. + Optional. Input only. An identifier which selects 'audio + effects' profiles that are applied on (post synthesized) text + to speech. Effects are applied on top of each other in the + order they are given. See `audio profiles + `__ for current supported profile ids. """, # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.AudioConfig) ), @@ -914,10 +924,11 @@ Attributes: audio_content: The audio data bytes encoded as specified in the request, - including the header (For LINEAR16 audio, we include the WAV - header). Note: as with all bytes fields, protobuffers use a - pure binary representation, whereas JSON representations use - base64. + including the header for encodings that are wrapped in + containers (e.g. MP3, OGG\_OPUS). For LINEAR16 audio, we + include the WAV header. Note: as with all bytes fields, + protobuffers use a pure binary representation, whereas JSON + representations use base64. """, # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse) ), @@ -926,15 +937,28 @@ DESCRIPTOR._options = None +_LISTVOICESREQUEST.fields_by_name["language_code"]._options = None +_SYNTHESIZESPEECHREQUEST.fields_by_name["input"]._options = None +_SYNTHESIZESPEECHREQUEST.fields_by_name["voice"]._options = None +_SYNTHESIZESPEECHREQUEST.fields_by_name["audio_config"]._options = None +_VOICESELECTIONPARAMS.fields_by_name["language_code"]._options = None +_AUDIOCONFIG.fields_by_name["audio_encoding"]._options = None +_AUDIOCONFIG.fields_by_name["speaking_rate"]._options = None +_AUDIOCONFIG.fields_by_name["pitch"]._options = None +_AUDIOCONFIG.fields_by_name["volume_gain_db"]._options = None +_AUDIOCONFIG.fields_by_name["sample_rate_hertz"]._options = None +_AUDIOCONFIG.fields_by_name["effects_profile_id"]._options = None _TEXTTOSPEECH = _descriptor.ServiceDescriptor( name="TextToSpeech", full_name="google.cloud.texttospeech.v1beta1.TextToSpeech", file=DESCRIPTOR, index=0, - serialized_options=None, - serialized_start=1275, - serialized_end=1617, + serialized_options=_b( + "\312A\033texttospeech.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" + ), + serialized_start=1400, + serialized_end=1866, methods=[ _descriptor.MethodDescriptor( name="ListVoices", @@ -943,7 +967,9 @@ containing_service=None, input_type=_LISTVOICESREQUEST, output_type=_LISTVOICESRESPONSE, - serialized_options=_b("\202\323\344\223\002\021\022\017/v1beta1/voices"), + serialized_options=_b( + "\202\323\344\223\002\021\022\017/v1beta1/voices\332A\rlanguage_code" + ), ), _descriptor.MethodDescriptor( name="SynthesizeSpeech", @@ -953,7 +979,7 @@ input_type=_SYNTHESIZESPEECHREQUEST, output_type=_SYNTHESIZESPEECHRESPONSE, serialized_options=_b( - '\202\323\344\223\002\035"\030/v1beta1/text:synthesize:\001*' + '\202\323\344\223\002\035"\030/v1beta1/text:synthesize:\001*\332A\030input,voice,audio_config' ), ), ], diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py index 3aaa81701692..a469e83d1f46 100644 --- a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py +++ b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py @@ -33,8 +33,7 @@ class TextToSpeechServicer(object): """ def ListVoices(self, request, context): - """Returns a list of [Voice][google.cloud.texttospeech.v1beta1.Voice] - supported for synthesis. + """Returns a list of Voice supported for synthesis. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") diff --git a/texttospeech/synth.metadata b/texttospeech/synth.metadata index 55fda3f44d74..e2cc9a3dd95a 100644 --- a/texttospeech/synth.metadata +++ b/texttospeech/synth.metadata @@ -1,19 +1,18 @@ { - "updateTime": "2019-08-06T12:43:45.265950Z", + "updateTime": "2019-09-10T12:35:21.962178Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.1", - "dockerImage": "googleapis/artman@sha256:a684d40ba9a4e15946f5f2ca6b4bd9fe301192f522e9de4fff622118775f309b" + "version": "0.36.2", + "dockerImage": "googleapis/artman@sha256:0e6f3a668cd68afc768ecbe08817cf6e56a0e64fcbdb1c58c3b97492d12418a1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e699b0cba64ffddfae39633417180f1f65875896", - "internalRef": "261759677" + "sha": "26e189ad03ba63591fb26eecb6aaade7ad39f57a" } }, {