diff --git a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts.proto b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts.proto index cc6237ae75c..e545c17b6dc 100644 --- a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts.proto +++ b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts.proto @@ -21,7 +21,6 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.TextToSpeech.V1"; option go_package = "cloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb"; option java_multiple_files = true; @@ -208,6 +207,22 @@ message CustomPronunciations { repeated CustomPronunciationParams pronunciations = 1; } +// A collection of turns for multi-speaker synthesis. +message MultiSpeakerMarkup { + // A Multi-speaker turn. + message Turn { + // Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + // to documentation for available speakers. + string speaker = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The text to speak. + string text = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Speaker turns. + repeated Turn turns = 1 [(google.api.field_behavior) = REQUIRED]; +} + // Contains text input to be synthesized. Either `text` or `ssml` must be // supplied. Supplying both or neither returns // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The @@ -224,6 +239,10 @@ message SynthesisInput { // more information, see // [SSML](https://cloud.google.com/text-to-speech/docs/ssml). string ssml = 2; + + // The multi-speaker input to be synthesized. Only applicable for + // multi-speaker synthesis. + MultiSpeakerMarkup multi_speaker_markup = 4; } // Optional. The pronunciation customizations to be applied to the input. If @@ -273,6 +292,11 @@ message VoiceSelectionParams { // the service will choose the custom voice matching the specified // configuration. CustomVoiceParams custom_voice = 4; + + // Optional. The configuration for a voice clone. If + // [VoiceCloneParams.voice_clone_key] is set, the service will choose the + // voice clone matching the specified configuration. + VoiceCloneParams voice_clone = 5 [(google.api.field_behavior) = OPTIONAL]; } // Description of audio data to be synthesized. @@ -360,6 +384,12 @@ message CustomVoiceParams { [deprecated = true, (google.api.field_behavior) = OPTIONAL]; } +// The configuration of Voice Clone feature. +message VoiceCloneParams { + // Required. Created by GenerateVoiceCloningKey. + string voice_cloning_key = 1 [(google.api.field_behavior) = REQUIRED]; +} + // The message returned to the client by the `SynthesizeSpeech` method. message SynthesizeSpeechResponse { // The audio data bytes encoded as specified in the request, including the diff --git a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto index 8eb8605c24c..985138f9a4e 100644 --- a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto +++ b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1/cloud_tts_lrs.proto @@ -23,7 +23,6 @@ import "google/cloud/texttospeech/v1/cloud_tts.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.TextToSpeech.V1"; option go_package = "cloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb"; option java_multiple_files = true; diff --git a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto index 03642c6e46d..6616fe854a8 100644 --- a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto +++ b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto @@ -21,7 +21,6 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.TextToSpeech.V1Beta1"; option go_package = "cloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb"; option java_multiple_files = true; @@ -223,6 +222,22 @@ message CustomPronunciations { repeated CustomPronunciationParams pronunciations = 1; } +// A collection of turns for multi-speaker synthesis. +message MultiSpeakerMarkup { + // A Multi-speaker turn. + message Turn { + // Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + // to documentation for available speakers. + string speaker = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The text to speak. + string text = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Speaker turns. + repeated Turn turns = 1 [(google.api.field_behavior) = REQUIRED]; +} + // Contains text input to be synthesized. Either `text` or `ssml` must be // supplied. Supplying both or neither returns // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The @@ -239,6 +254,10 @@ message SynthesisInput { // more information, see // [SSML](https://cloud.google.com/text-to-speech/docs/ssml). string ssml = 2; + + // The multi-speaker input to be synthesized. Only applicable for + // multi-speaker synthesis. + MultiSpeakerMarkup multi_speaker_markup = 4; } // Optional. The pronunciation customizations to be applied to the input. If @@ -288,6 +307,11 @@ message VoiceSelectionParams { // the service will choose the custom voice matching the specified // configuration. CustomVoiceParams custom_voice = 4; + + // Optional. The configuration for a voice clone. If + // [VoiceCloneParams.voice_clone_key] is set, the service will choose the + // voice clone matching the specified configuration. + VoiceCloneParams voice_clone = 5 [(google.api.field_behavior) = OPTIONAL]; } // Description of audio data to be synthesized. @@ -375,6 +399,12 @@ message CustomVoiceParams { [deprecated = true, (google.api.field_behavior) = OPTIONAL]; } +// The configuration of Voice Clone feature. +message VoiceCloneParams { + // Required. Created by GenerateVoiceCloningKey. + string voice_cloning_key = 1 [(google.api.field_behavior) = REQUIRED]; +} + // The message returned to the client by the `SynthesizeSpeech` method. message SynthesizeSpeechResponse { // The audio data bytes encoded as specified in the request, including the diff --git a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto index 969dfd99396..a3294e9926e 100644 --- a/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto +++ b/packages/google-cloud-texttospeech/protos/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto @@ -23,7 +23,6 @@ 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 = "cloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb"; option java_multiple_files = true; diff --git a/packages/google-cloud-texttospeech/protos/protos.d.ts b/packages/google-cloud-texttospeech/protos/protos.d.ts index eeacab05479..80c6d9b83b5 100644 --- a/packages/google-cloud-texttospeech/protos/protos.d.ts +++ b/packages/google-cloud-texttospeech/protos/protos.d.ts @@ -883,6 +883,209 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MultiSpeakerMarkup. */ + interface IMultiSpeakerMarkup { + + /** MultiSpeakerMarkup turns */ + turns?: (google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn[]|null); + } + + /** Represents a MultiSpeakerMarkup. */ + class MultiSpeakerMarkup implements IMultiSpeakerMarkup { + + /** + * Constructs a new MultiSpeakerMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.texttospeech.v1.IMultiSpeakerMarkup); + + /** MultiSpeakerMarkup turns. */ + public turns: google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn[]; + + /** + * Creates a new MultiSpeakerMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiSpeakerMarkup instance + */ + public static create(properties?: google.cloud.texttospeech.v1.IMultiSpeakerMarkup): google.cloud.texttospeech.v1.MultiSpeakerMarkup; + + /** + * Encodes the specified MultiSpeakerMarkup message. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.verify|verify} messages. + * @param message MultiSpeakerMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.texttospeech.v1.IMultiSpeakerMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiSpeakerMarkup message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.verify|verify} messages. + * @param message MultiSpeakerMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.texttospeech.v1.IMultiSpeakerMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiSpeakerMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.texttospeech.v1.MultiSpeakerMarkup; + + /** + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiSpeakerMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.texttospeech.v1.MultiSpeakerMarkup; + + /** + * Verifies a MultiSpeakerMarkup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiSpeakerMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiSpeakerMarkup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.MultiSpeakerMarkup; + + /** + * Creates a plain object from a MultiSpeakerMarkup message. Also converts values to other types if specified. + * @param message MultiSpeakerMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.texttospeech.v1.MultiSpeakerMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiSpeakerMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiSpeakerMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiSpeakerMarkup { + + /** Properties of a Turn. */ + interface ITurn { + + /** Turn speaker */ + speaker?: (string|null); + + /** Turn text */ + text?: (string|null); + } + + /** Represents a Turn. */ + class Turn implements ITurn { + + /** + * Constructs a new Turn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn); + + /** Turn speaker. */ + public speaker: string; + + /** Turn text. */ + public text: string; + + /** + * Creates a new Turn instance using the specified properties. + * @param [properties] Properties to set + * @returns Turn instance + */ + public static create(properties?: google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn): google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn; + + /** + * Verifies a Turn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Turn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @param message Turn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Turn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Turn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a SynthesisInput. */ interface ISynthesisInput { @@ -892,6 +1095,9 @@ export namespace google { /** SynthesisInput ssml */ ssml?: (string|null); + /** SynthesisInput multiSpeakerMarkup */ + multiSpeakerMarkup?: (google.cloud.texttospeech.v1.IMultiSpeakerMarkup|null); + /** SynthesisInput customPronunciations */ customPronunciations?: (google.cloud.texttospeech.v1.ICustomPronunciations|null); } @@ -911,11 +1117,14 @@ export namespace google { /** SynthesisInput ssml. */ public ssml?: (string|null); + /** SynthesisInput multiSpeakerMarkup. */ + public multiSpeakerMarkup?: (google.cloud.texttospeech.v1.IMultiSpeakerMarkup|null); + /** SynthesisInput customPronunciations. */ public customPronunciations?: (google.cloud.texttospeech.v1.ICustomPronunciations|null); /** SynthesisInput inputSource. */ - public inputSource?: ("text"|"ssml"); + public inputSource?: ("text"|"ssml"|"multiSpeakerMarkup"); /** * Creates a new SynthesisInput instance using the specified properties. @@ -1009,6 +1218,9 @@ export namespace google { /** VoiceSelectionParams customVoice */ customVoice?: (google.cloud.texttospeech.v1.ICustomVoiceParams|null); + + /** VoiceSelectionParams voiceClone */ + voiceClone?: (google.cloud.texttospeech.v1.IVoiceCloneParams|null); } /** Represents a VoiceSelectionParams. */ @@ -1032,6 +1244,9 @@ export namespace google { /** VoiceSelectionParams customVoice. */ public customVoice?: (google.cloud.texttospeech.v1.ICustomVoiceParams|null); + /** VoiceSelectionParams voiceClone. */ + public voiceClone?: (google.cloud.texttospeech.v1.IVoiceCloneParams|null); + /** * Creates a new VoiceSelectionParams instance using the specified properties. * @param [properties] Properties to set @@ -1350,6 +1565,103 @@ export namespace google { } } + /** Properties of a VoiceCloneParams. */ + interface IVoiceCloneParams { + + /** VoiceCloneParams voiceCloningKey */ + voiceCloningKey?: (string|null); + } + + /** Represents a VoiceCloneParams. */ + class VoiceCloneParams implements IVoiceCloneParams { + + /** + * Constructs a new VoiceCloneParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.texttospeech.v1.IVoiceCloneParams); + + /** VoiceCloneParams voiceCloningKey. */ + public voiceCloningKey: string; + + /** + * Creates a new VoiceCloneParams instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceCloneParams instance + */ + public static create(properties?: google.cloud.texttospeech.v1.IVoiceCloneParams): google.cloud.texttospeech.v1.VoiceCloneParams; + + /** + * Encodes the specified VoiceCloneParams message. Does not implicitly {@link google.cloud.texttospeech.v1.VoiceCloneParams.verify|verify} messages. + * @param message VoiceCloneParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.texttospeech.v1.IVoiceCloneParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceCloneParams message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.VoiceCloneParams.verify|verify} messages. + * @param message VoiceCloneParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.texttospeech.v1.IVoiceCloneParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.texttospeech.v1.VoiceCloneParams; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.texttospeech.v1.VoiceCloneParams; + + /** + * Verifies a VoiceCloneParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceCloneParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceCloneParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.VoiceCloneParams; + + /** + * Creates a plain object from a VoiceCloneParams message. Also converts values to other types if specified. + * @param message VoiceCloneParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.texttospeech.v1.VoiceCloneParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceCloneParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceCloneParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SynthesizeSpeechResponse. */ interface ISynthesizeSpeechResponse { @@ -3090,6 +3402,209 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MultiSpeakerMarkup. */ + interface IMultiSpeakerMarkup { + + /** MultiSpeakerMarkup turns */ + turns?: (google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn[]|null); + } + + /** Represents a MultiSpeakerMarkup. */ + class MultiSpeakerMarkup implements IMultiSpeakerMarkup { + + /** + * Constructs a new MultiSpeakerMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup); + + /** MultiSpeakerMarkup turns. */ + public turns: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn[]; + + /** + * Creates a new MultiSpeakerMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiSpeakerMarkup instance + */ + public static create(properties?: google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup; + + /** + * Encodes the specified MultiSpeakerMarkup message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.verify|verify} messages. + * @param message MultiSpeakerMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiSpeakerMarkup message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.verify|verify} messages. + * @param message MultiSpeakerMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiSpeakerMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup; + + /** + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiSpeakerMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup; + + /** + * Verifies a MultiSpeakerMarkup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiSpeakerMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiSpeakerMarkup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup; + + /** + * Creates a plain object from a MultiSpeakerMarkup message. Also converts values to other types if specified. + * @param message MultiSpeakerMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiSpeakerMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiSpeakerMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiSpeakerMarkup { + + /** Properties of a Turn. */ + interface ITurn { + + /** Turn speaker */ + speaker?: (string|null); + + /** Turn text */ + text?: (string|null); + } + + /** Represents a Turn. */ + class Turn implements ITurn { + + /** + * Constructs a new Turn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn); + + /** Turn speaker. */ + public speaker: string; + + /** Turn text. */ + public text: string; + + /** + * Creates a new Turn instance using the specified properties. + * @param [properties] Properties to set + * @returns Turn instance + */ + public static create(properties?: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @param message Turn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn; + + /** + * Verifies a Turn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Turn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @param message Turn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Turn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Turn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a SynthesisInput. */ interface ISynthesisInput { @@ -3099,6 +3614,9 @@ export namespace google { /** SynthesisInput ssml */ ssml?: (string|null); + /** SynthesisInput multiSpeakerMarkup */ + multiSpeakerMarkup?: (google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup|null); + /** SynthesisInput customPronunciations */ customPronunciations?: (google.cloud.texttospeech.v1beta1.ICustomPronunciations|null); } @@ -3118,11 +3636,14 @@ export namespace google { /** SynthesisInput ssml. */ public ssml?: (string|null); + /** SynthesisInput multiSpeakerMarkup. */ + public multiSpeakerMarkup?: (google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup|null); + /** SynthesisInput customPronunciations. */ public customPronunciations?: (google.cloud.texttospeech.v1beta1.ICustomPronunciations|null); /** SynthesisInput inputSource. */ - public inputSource?: ("text"|"ssml"); + public inputSource?: ("text"|"ssml"|"multiSpeakerMarkup"); /** * Creates a new SynthesisInput instance using the specified properties. @@ -3216,6 +3737,9 @@ export namespace google { /** VoiceSelectionParams customVoice */ customVoice?: (google.cloud.texttospeech.v1beta1.ICustomVoiceParams|null); + + /** VoiceSelectionParams voiceClone */ + voiceClone?: (google.cloud.texttospeech.v1beta1.IVoiceCloneParams|null); } /** Represents a VoiceSelectionParams. */ @@ -3239,6 +3763,9 @@ export namespace google { /** VoiceSelectionParams customVoice. */ public customVoice?: (google.cloud.texttospeech.v1beta1.ICustomVoiceParams|null); + /** VoiceSelectionParams voiceClone. */ + public voiceClone?: (google.cloud.texttospeech.v1beta1.IVoiceCloneParams|null); + /** * Creates a new VoiceSelectionParams instance using the specified properties. * @param [properties] Properties to set @@ -3557,6 +4084,103 @@ export namespace google { } } + /** Properties of a VoiceCloneParams. */ + interface IVoiceCloneParams { + + /** VoiceCloneParams voiceCloningKey */ + voiceCloningKey?: (string|null); + } + + /** Represents a VoiceCloneParams. */ + class VoiceCloneParams implements IVoiceCloneParams { + + /** + * Constructs a new VoiceCloneParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.texttospeech.v1beta1.IVoiceCloneParams); + + /** VoiceCloneParams voiceCloningKey. */ + public voiceCloningKey: string; + + /** + * Creates a new VoiceCloneParams instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceCloneParams instance + */ + public static create(properties?: google.cloud.texttospeech.v1beta1.IVoiceCloneParams): google.cloud.texttospeech.v1beta1.VoiceCloneParams; + + /** + * Encodes the specified VoiceCloneParams message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.VoiceCloneParams.verify|verify} messages. + * @param message VoiceCloneParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.texttospeech.v1beta1.IVoiceCloneParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceCloneParams message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.VoiceCloneParams.verify|verify} messages. + * @param message VoiceCloneParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.texttospeech.v1beta1.IVoiceCloneParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.texttospeech.v1beta1.VoiceCloneParams; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.texttospeech.v1beta1.VoiceCloneParams; + + /** + * Verifies a VoiceCloneParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceCloneParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceCloneParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1beta1.VoiceCloneParams; + + /** + * Creates a plain object from a VoiceCloneParams message. Also converts values to other types if specified. + * @param message VoiceCloneParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.texttospeech.v1beta1.VoiceCloneParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceCloneParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceCloneParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SynthesizeSpeechResponse. */ interface ISynthesizeSpeechResponse { diff --git a/packages/google-cloud-texttospeech/protos/protos.js b/packages/google-cloud-texttospeech/protos/protos.js index e16cc9a8e1a..97eca850876 100644 --- a/packages/google-cloud-texttospeech/protos/protos.js +++ b/packages/google-cloud-texttospeech/protos/protos.js @@ -2081,6 +2081,457 @@ return CustomPronunciations; })(); + v1.MultiSpeakerMarkup = (function() { + + /** + * Properties of a MultiSpeakerMarkup. + * @memberof google.cloud.texttospeech.v1 + * @interface IMultiSpeakerMarkup + * @property {Array.|null} [turns] MultiSpeakerMarkup turns + */ + + /** + * Constructs a new MultiSpeakerMarkup. + * @memberof google.cloud.texttospeech.v1 + * @classdesc Represents a MultiSpeakerMarkup. + * @implements IMultiSpeakerMarkup + * @constructor + * @param {google.cloud.texttospeech.v1.IMultiSpeakerMarkup=} [properties] Properties to set + */ + function MultiSpeakerMarkup(properties) { + this.turns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiSpeakerMarkup turns. + * @member {Array.} turns + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @instance + */ + MultiSpeakerMarkup.prototype.turns = $util.emptyArray; + + /** + * Creates a new MultiSpeakerMarkup instance using the specified properties. + * @function create + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {google.cloud.texttospeech.v1.IMultiSpeakerMarkup=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup} MultiSpeakerMarkup instance + */ + MultiSpeakerMarkup.create = function create(properties) { + return new MultiSpeakerMarkup(properties); + }; + + /** + * Encodes the specified MultiSpeakerMarkup message. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.verify|verify} messages. + * @function encode + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {google.cloud.texttospeech.v1.IMultiSpeakerMarkup} message MultiSpeakerMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSpeakerMarkup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.encode(message.turns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MultiSpeakerMarkup message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {google.cloud.texttospeech.v1.IMultiSpeakerMarkup} message MultiSpeakerMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiSpeakerMarkup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup} MultiSpeakerMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSpeakerMarkup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup} MultiSpeakerMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiSpeakerMarkup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiSpeakerMarkup message. + * @function verify + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiSpeakerMarkup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + return null; + }; + + /** + * Creates a MultiSpeakerMarkup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup} MultiSpeakerMarkup + */ + MultiSpeakerMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup) + return object; + var message = new $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup(); + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.texttospeech.v1.MultiSpeakerMarkup.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.texttospeech.v1.MultiSpeakerMarkup.turns: object expected"); + message.turns[i] = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.fromObject(object.turns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MultiSpeakerMarkup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {google.cloud.texttospeech.v1.MultiSpeakerMarkup} message MultiSpeakerMarkup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiSpeakerMarkup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.turns = []; + if (message.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.toObject(message.turns[j], options); + } + return object; + }; + + /** + * Converts this MultiSpeakerMarkup to JSON. + * @function toJSON + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @instance + * @returns {Object.} JSON object + */ + MultiSpeakerMarkup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiSpeakerMarkup + * @function getTypeUrl + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiSpeakerMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.texttospeech.v1.MultiSpeakerMarkup"; + }; + + MultiSpeakerMarkup.Turn = (function() { + + /** + * Properties of a Turn. + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @interface ITurn + * @property {string|null} [speaker] Turn speaker + * @property {string|null} [text] Turn text + */ + + /** + * Constructs a new Turn. + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup + * @classdesc Represents a Turn. + * @implements ITurn + * @constructor + * @param {google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn=} [properties] Properties to set + */ + function Turn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Turn speaker. + * @member {string} speaker + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @instance + */ + Turn.prototype.speaker = ""; + + /** + * Turn text. + * @member {string} text + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @instance + */ + Turn.prototype.text = ""; + + /** + * Creates a new Turn instance using the specified properties. + * @function create + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn} Turn instance + */ + Turn.create = function create(properties) { + return new Turn(properties); + }; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @function encode + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speaker != null && Object.hasOwnProperty.call(message, "speaker")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.speaker); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1.MultiSpeakerMarkup.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.speaker = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Turn message. + * @function verify + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Turn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speaker != null && message.hasOwnProperty("speaker")) + if (!$util.isString(message.speaker)) + return "speaker: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn} Turn + */ + Turn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn) + return object; + var message = new $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn(); + if (object.speaker != null) + message.speaker = String(object.speaker); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn} message Turn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Turn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speaker = ""; + object.text = ""; + } + if (message.speaker != null && message.hasOwnProperty("speaker")) + object.speaker = message.speaker; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this Turn to JSON. + * @function toJSON + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @instance + * @returns {Object.} JSON object + */ + Turn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Turn + * @function getTypeUrl + * @memberof google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn"; + }; + + return Turn; + })(); + + return MultiSpeakerMarkup; + })(); + v1.SynthesisInput = (function() { /** @@ -2089,6 +2540,7 @@ * @interface ISynthesisInput * @property {string|null} [text] SynthesisInput text * @property {string|null} [ssml] SynthesisInput ssml + * @property {google.cloud.texttospeech.v1.IMultiSpeakerMarkup|null} [multiSpeakerMarkup] SynthesisInput multiSpeakerMarkup * @property {google.cloud.texttospeech.v1.ICustomPronunciations|null} [customPronunciations] SynthesisInput customPronunciations */ @@ -2123,6 +2575,14 @@ */ SynthesisInput.prototype.ssml = null; + /** + * SynthesisInput multiSpeakerMarkup. + * @member {google.cloud.texttospeech.v1.IMultiSpeakerMarkup|null|undefined} multiSpeakerMarkup + * @memberof google.cloud.texttospeech.v1.SynthesisInput + * @instance + */ + SynthesisInput.prototype.multiSpeakerMarkup = null; + /** * SynthesisInput customPronunciations. * @member {google.cloud.texttospeech.v1.ICustomPronunciations|null|undefined} customPronunciations @@ -2136,12 +2596,12 @@ /** * SynthesisInput inputSource. - * @member {"text"|"ssml"|undefined} inputSource + * @member {"text"|"ssml"|"multiSpeakerMarkup"|undefined} inputSource * @memberof google.cloud.texttospeech.v1.SynthesisInput * @instance */ Object.defineProperty(SynthesisInput.prototype, "inputSource", { - get: $util.oneOfGetter($oneOfFields = ["text", "ssml"]), + get: $util.oneOfGetter($oneOfFields = ["text", "ssml", "multiSpeakerMarkup"]), set: $util.oneOfSetter($oneOfFields) }); @@ -2175,6 +2635,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); if (message.customPronunciations != null && Object.hasOwnProperty.call(message, "customPronunciations")) $root.google.cloud.texttospeech.v1.CustomPronunciations.encode(message.customPronunciations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.multiSpeakerMarkup != null && Object.hasOwnProperty.call(message, "multiSpeakerMarkup")) + $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.encode(message.multiSpeakerMarkup, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -2217,6 +2679,10 @@ message.ssml = reader.string(); break; } + case 4: { + message.multiSpeakerMarkup = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.decode(reader, reader.uint32()); + break; + } case 3: { message.customPronunciations = $root.google.cloud.texttospeech.v1.CustomPronunciations.decode(reader, reader.uint32()); break; @@ -2269,6 +2735,16 @@ if (!$util.isString(message.ssml)) return "ssml: string expected"; } + if (message.multiSpeakerMarkup != null && message.hasOwnProperty("multiSpeakerMarkup")) { + if (properties.inputSource === 1) + return "inputSource: multiple values"; + properties.inputSource = 1; + { + var error = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.verify(message.multiSpeakerMarkup); + if (error) + return "multiSpeakerMarkup." + error; + } + } if (message.customPronunciations != null && message.hasOwnProperty("customPronunciations")) { var error = $root.google.cloud.texttospeech.v1.CustomPronunciations.verify(message.customPronunciations); if (error) @@ -2293,6 +2769,11 @@ message.text = String(object.text); if (object.ssml != null) message.ssml = String(object.ssml); + if (object.multiSpeakerMarkup != null) { + if (typeof object.multiSpeakerMarkup !== "object") + throw TypeError(".google.cloud.texttospeech.v1.SynthesisInput.multiSpeakerMarkup: object expected"); + message.multiSpeakerMarkup = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.fromObject(object.multiSpeakerMarkup); + } if (object.customPronunciations != null) { if (typeof object.customPronunciations !== "object") throw TypeError(".google.cloud.texttospeech.v1.SynthesisInput.customPronunciations: object expected"); @@ -2328,6 +2809,11 @@ } if (message.customPronunciations != null && message.hasOwnProperty("customPronunciations")) object.customPronunciations = $root.google.cloud.texttospeech.v1.CustomPronunciations.toObject(message.customPronunciations, options); + if (message.multiSpeakerMarkup != null && message.hasOwnProperty("multiSpeakerMarkup")) { + object.multiSpeakerMarkup = $root.google.cloud.texttospeech.v1.MultiSpeakerMarkup.toObject(message.multiSpeakerMarkup, options); + if (options.oneofs) + object.inputSource = "multiSpeakerMarkup"; + } return object; }; @@ -2370,6 +2856,7 @@ * @property {string|null} [name] VoiceSelectionParams name * @property {google.cloud.texttospeech.v1.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender * @property {google.cloud.texttospeech.v1.ICustomVoiceParams|null} [customVoice] VoiceSelectionParams customVoice + * @property {google.cloud.texttospeech.v1.IVoiceCloneParams|null} [voiceClone] VoiceSelectionParams voiceClone */ /** @@ -2419,6 +2906,14 @@ */ VoiceSelectionParams.prototype.customVoice = null; + /** + * VoiceSelectionParams voiceClone. + * @member {google.cloud.texttospeech.v1.IVoiceCloneParams|null|undefined} voiceClone + * @memberof google.cloud.texttospeech.v1.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.voiceClone = null; + /** * Creates a new VoiceSelectionParams instance using the specified properties. * @function create @@ -2451,6 +2946,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ssmlGender); if (message.customVoice != null && Object.hasOwnProperty.call(message, "customVoice")) $root.google.cloud.texttospeech.v1.CustomVoiceParams.encode(message.customVoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.voiceClone != null && Object.hasOwnProperty.call(message, "voiceClone")) + $root.google.cloud.texttospeech.v1.VoiceCloneParams.encode(message.voiceClone, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -2501,6 +2998,10 @@ message.customVoice = $root.google.cloud.texttospeech.v1.CustomVoiceParams.decode(reader, reader.uint32()); break; } + case 5: { + message.voiceClone = $root.google.cloud.texttospeech.v1.VoiceCloneParams.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2557,6 +3058,11 @@ if (error) return "customVoice." + error; } + if (message.voiceClone != null && message.hasOwnProperty("voiceClone")) { + var error = $root.google.cloud.texttospeech.v1.VoiceCloneParams.verify(message.voiceClone); + if (error) + return "voiceClone." + error; + } return null; }; @@ -2605,6 +3111,11 @@ throw TypeError(".google.cloud.texttospeech.v1.VoiceSelectionParams.customVoice: object expected"); message.customVoice = $root.google.cloud.texttospeech.v1.CustomVoiceParams.fromObject(object.customVoice); } + if (object.voiceClone != null) { + if (typeof object.voiceClone !== "object") + throw TypeError(".google.cloud.texttospeech.v1.VoiceSelectionParams.voiceClone: object expected"); + message.voiceClone = $root.google.cloud.texttospeech.v1.VoiceCloneParams.fromObject(object.voiceClone); + } return message; }; @@ -2626,6 +3137,7 @@ object.name = ""; object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; object.customVoice = null; + object.voiceClone = null; } if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; @@ -2635,6 +3147,8 @@ object.ssmlGender = options.enums === String ? $root.google.cloud.texttospeech.v1.SsmlVoiceGender[message.ssmlGender] === undefined ? message.ssmlGender : $root.google.cloud.texttospeech.v1.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; if (message.customVoice != null && message.hasOwnProperty("customVoice")) object.customVoice = $root.google.cloud.texttospeech.v1.CustomVoiceParams.toObject(message.customVoice, options); + if (message.voiceClone != null && message.hasOwnProperty("voiceClone")) + object.voiceClone = $root.google.cloud.texttospeech.v1.VoiceCloneParams.toObject(message.voiceClone, options); return object; }; @@ -3241,72 +3755,275 @@ }; /** - * Creates a plain object from a CustomVoiceParams message. Also converts values to other types if specified. + * Creates a plain object from a CustomVoiceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.texttospeech.v1.CustomVoiceParams + * @static + * @param {google.cloud.texttospeech.v1.CustomVoiceParams} message CustomVoiceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomVoiceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.reportedUsage = options.enums === String ? "REPORTED_USAGE_UNSPECIFIED" : 0; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.reportedUsage != null && message.hasOwnProperty("reportedUsage")) + object.reportedUsage = options.enums === String ? $root.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage[message.reportedUsage] === undefined ? message.reportedUsage : $root.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage[message.reportedUsage] : message.reportedUsage; + return object; + }; + + /** + * Converts this CustomVoiceParams to JSON. + * @function toJSON + * @memberof google.cloud.texttospeech.v1.CustomVoiceParams + * @instance + * @returns {Object.} JSON object + */ + CustomVoiceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomVoiceParams + * @function getTypeUrl + * @memberof google.cloud.texttospeech.v1.CustomVoiceParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomVoiceParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.texttospeech.v1.CustomVoiceParams"; + }; + + /** + * ReportedUsage enum. + * @name google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage + * @enum {number} + * @property {number} REPORTED_USAGE_UNSPECIFIED=0 REPORTED_USAGE_UNSPECIFIED value + * @property {number} REALTIME=1 REALTIME value + * @property {number} OFFLINE=2 OFFLINE value + */ + CustomVoiceParams.ReportedUsage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPORTED_USAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REALTIME"] = 1; + values[valuesById[2] = "OFFLINE"] = 2; + return values; + })(); + + return CustomVoiceParams; + })(); + + v1.VoiceCloneParams = (function() { + + /** + * Properties of a VoiceCloneParams. + * @memberof google.cloud.texttospeech.v1 + * @interface IVoiceCloneParams + * @property {string|null} [voiceCloningKey] VoiceCloneParams voiceCloningKey + */ + + /** + * Constructs a new VoiceCloneParams. + * @memberof google.cloud.texttospeech.v1 + * @classdesc Represents a VoiceCloneParams. + * @implements IVoiceCloneParams + * @constructor + * @param {google.cloud.texttospeech.v1.IVoiceCloneParams=} [properties] Properties to set + */ + function VoiceCloneParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceCloneParams voiceCloningKey. + * @member {string} voiceCloningKey + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @instance + */ + VoiceCloneParams.prototype.voiceCloningKey = ""; + + /** + * Creates a new VoiceCloneParams instance using the specified properties. + * @function create + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1.IVoiceCloneParams=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1.VoiceCloneParams} VoiceCloneParams instance + */ + VoiceCloneParams.create = function create(properties) { + return new VoiceCloneParams(properties); + }; + + /** + * Encodes the specified VoiceCloneParams message. Does not implicitly {@link google.cloud.texttospeech.v1.VoiceCloneParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1.IVoiceCloneParams} message VoiceCloneParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceCloneParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceCloningKey != null && Object.hasOwnProperty.call(message, "voiceCloningKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceCloningKey); + return writer; + }; + + /** + * Encodes the specified VoiceCloneParams message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.VoiceCloneParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1.IVoiceCloneParams} message VoiceCloneParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceCloneParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.texttospeech.v1.VoiceCloneParams} VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceCloneParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1.VoiceCloneParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceCloningKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.texttospeech.v1.VoiceCloneParams} VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceCloneParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceCloneParams message. + * @function verify + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceCloneParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voiceCloningKey != null && message.hasOwnProperty("voiceCloningKey")) + if (!$util.isString(message.voiceCloningKey)) + return "voiceCloningKey: string expected"; + return null; + }; + + /** + * Creates a VoiceCloneParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.texttospeech.v1.VoiceCloneParams} VoiceCloneParams + */ + VoiceCloneParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1.VoiceCloneParams) + return object; + var message = new $root.google.cloud.texttospeech.v1.VoiceCloneParams(); + if (object.voiceCloningKey != null) + message.voiceCloningKey = String(object.voiceCloningKey); + return message; + }; + + /** + * Creates a plain object from a VoiceCloneParams message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.texttospeech.v1.CustomVoiceParams + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams * @static - * @param {google.cloud.texttospeech.v1.CustomVoiceParams} message CustomVoiceParams + * @param {google.cloud.texttospeech.v1.VoiceCloneParams} message VoiceCloneParams * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomVoiceParams.toObject = function toObject(message, options) { + VoiceCloneParams.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.model = ""; - object.reportedUsage = options.enums === String ? "REPORTED_USAGE_UNSPECIFIED" : 0; - } - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.reportedUsage != null && message.hasOwnProperty("reportedUsage")) - object.reportedUsage = options.enums === String ? $root.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage[message.reportedUsage] === undefined ? message.reportedUsage : $root.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage[message.reportedUsage] : message.reportedUsage; + if (options.defaults) + object.voiceCloningKey = ""; + if (message.voiceCloningKey != null && message.hasOwnProperty("voiceCloningKey")) + object.voiceCloningKey = message.voiceCloningKey; return object; }; /** - * Converts this CustomVoiceParams to JSON. + * Converts this VoiceCloneParams to JSON. * @function toJSON - * @memberof google.cloud.texttospeech.v1.CustomVoiceParams + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams * @instance * @returns {Object.} JSON object */ - CustomVoiceParams.prototype.toJSON = function toJSON() { + VoiceCloneParams.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CustomVoiceParams + * Gets the default type url for VoiceCloneParams * @function getTypeUrl - * @memberof google.cloud.texttospeech.v1.CustomVoiceParams + * @memberof google.cloud.texttospeech.v1.VoiceCloneParams * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CustomVoiceParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VoiceCloneParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.texttospeech.v1.CustomVoiceParams"; + return typeUrlPrefix + "/google.cloud.texttospeech.v1.VoiceCloneParams"; }; - /** - * ReportedUsage enum. - * @name google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage - * @enum {number} - * @property {number} REPORTED_USAGE_UNSPECIFIED=0 REPORTED_USAGE_UNSPECIFIED value - * @property {number} REALTIME=1 REALTIME value - * @property {number} OFFLINE=2 OFFLINE value - */ - CustomVoiceParams.ReportedUsage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPORTED_USAGE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REALTIME"] = 1; - values[valuesById[2] = "OFFLINE"] = 2; - return values; - })(); - - return CustomVoiceParams; + return VoiceCloneParams; })(); v1.SynthesizeSpeechResponse = (function() { @@ -7136,13 +7853,237 @@ /** * Constructs a new CustomPronunciations. * @memberof google.cloud.texttospeech.v1beta1 - * @classdesc Represents a CustomPronunciations. - * @implements ICustomPronunciations + * @classdesc Represents a CustomPronunciations. + * @implements ICustomPronunciations + * @constructor + * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations=} [properties] Properties to set + */ + function CustomPronunciations(properties) { + this.pronunciations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomPronunciations pronunciations. + * @member {Array.} pronunciations + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @instance + */ + CustomPronunciations.prototype.pronunciations = $util.emptyArray; + + /** + * Creates a new CustomPronunciations instance using the specified properties. + * @function create + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations instance + */ + CustomPronunciations.create = function create(properties) { + return new CustomPronunciations(properties); + }; + + /** + * Encodes the specified CustomPronunciations message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.CustomPronunciations.verify|verify} messages. + * @function encode + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations} message CustomPronunciations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomPronunciations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pronunciations != null && message.pronunciations.length) + for (var i = 0; i < message.pronunciations.length; ++i) + $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.encode(message.pronunciations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomPronunciations message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.CustomPronunciations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations} message CustomPronunciations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomPronunciations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomPronunciations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomPronunciations.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1beta1.CustomPronunciations(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.pronunciations && message.pronunciations.length)) + message.pronunciations = []; + message.pronunciations.push($root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomPronunciations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomPronunciations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomPronunciations message. + * @function verify + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomPronunciations.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pronunciations != null && message.hasOwnProperty("pronunciations")) { + if (!Array.isArray(message.pronunciations)) + return "pronunciations: array expected"; + for (var i = 0; i < message.pronunciations.length; ++i) { + var error = $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.verify(message.pronunciations[i]); + if (error) + return "pronunciations." + error; + } + } + return null; + }; + + /** + * Creates a CustomPronunciations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations + */ + CustomPronunciations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1beta1.CustomPronunciations) + return object; + var message = new $root.google.cloud.texttospeech.v1beta1.CustomPronunciations(); + if (object.pronunciations) { + if (!Array.isArray(object.pronunciations)) + throw TypeError(".google.cloud.texttospeech.v1beta1.CustomPronunciations.pronunciations: array expected"); + message.pronunciations = []; + for (var i = 0; i < object.pronunciations.length; ++i) { + if (typeof object.pronunciations[i] !== "object") + throw TypeError(".google.cloud.texttospeech.v1beta1.CustomPronunciations.pronunciations: object expected"); + message.pronunciations[i] = $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.fromObject(object.pronunciations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomPronunciations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {google.cloud.texttospeech.v1beta1.CustomPronunciations} message CustomPronunciations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomPronunciations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pronunciations = []; + if (message.pronunciations && message.pronunciations.length) { + object.pronunciations = []; + for (var j = 0; j < message.pronunciations.length; ++j) + object.pronunciations[j] = $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.toObject(message.pronunciations[j], options); + } + return object; + }; + + /** + * Converts this CustomPronunciations to JSON. + * @function toJSON + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @instance + * @returns {Object.} JSON object + */ + CustomPronunciations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomPronunciations + * @function getTypeUrl + * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomPronunciations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.texttospeech.v1beta1.CustomPronunciations"; + }; + + return CustomPronunciations; + })(); + + v1beta1.MultiSpeakerMarkup = (function() { + + /** + * Properties of a MultiSpeakerMarkup. + * @memberof google.cloud.texttospeech.v1beta1 + * @interface IMultiSpeakerMarkup + * @property {Array.|null} [turns] MultiSpeakerMarkup turns + */ + + /** + * Constructs a new MultiSpeakerMarkup. + * @memberof google.cloud.texttospeech.v1beta1 + * @classdesc Represents a MultiSpeakerMarkup. + * @implements IMultiSpeakerMarkup * @constructor - * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations=} [properties] Properties to set + * @param {google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup=} [properties] Properties to set */ - function CustomPronunciations(properties) { - this.pronunciations = []; + function MultiSpeakerMarkup(properties) { + this.turns = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7150,78 +8091,78 @@ } /** - * CustomPronunciations pronunciations. - * @member {Array.} pronunciations - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * MultiSpeakerMarkup turns. + * @member {Array.} turns + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @instance */ - CustomPronunciations.prototype.pronunciations = $util.emptyArray; + MultiSpeakerMarkup.prototype.turns = $util.emptyArray; /** - * Creates a new CustomPronunciations instance using the specified properties. + * Creates a new MultiSpeakerMarkup instance using the specified properties. * @function create - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static - * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations=} [properties] Properties to set - * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations instance + * @param {google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup} MultiSpeakerMarkup instance */ - CustomPronunciations.create = function create(properties) { - return new CustomPronunciations(properties); + MultiSpeakerMarkup.create = function create(properties) { + return new MultiSpeakerMarkup(properties); }; /** - * Encodes the specified CustomPronunciations message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.CustomPronunciations.verify|verify} messages. + * Encodes the specified MultiSpeakerMarkup message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.verify|verify} messages. * @function encode - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static - * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations} message CustomPronunciations message or plain object to encode + * @param {google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup} message MultiSpeakerMarkup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomPronunciations.encode = function encode(message, writer) { + MultiSpeakerMarkup.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pronunciations != null && message.pronunciations.length) - for (var i = 0; i < message.pronunciations.length; ++i) - $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.encode(message.pronunciations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.encode(message.turns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CustomPronunciations message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.CustomPronunciations.verify|verify} messages. + * Encodes the specified MultiSpeakerMarkup message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static - * @param {google.cloud.texttospeech.v1beta1.ICustomPronunciations} message CustomPronunciations message or plain object to encode + * @param {google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup} message MultiSpeakerMarkup message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomPronunciations.encodeDelimited = function encodeDelimited(message, writer) { + MultiSpeakerMarkup.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomPronunciations message from the specified reader or buffer. + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer. * @function decode - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup} MultiSpeakerMarkup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomPronunciations.decode = function decode(reader, length) { + MultiSpeakerMarkup.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1beta1.CustomPronunciations(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.pronunciations && message.pronunciations.length)) - message.pronunciations = []; - message.pronunciations.push($root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.decode(reader, reader.uint32())); + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.decode(reader, reader.uint32())); break; } default: @@ -7233,119 +8174,346 @@ }; /** - * Decodes a CustomPronunciations message from the specified reader or buffer, length delimited. + * Decodes a MultiSpeakerMarkup message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup} MultiSpeakerMarkup * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomPronunciations.decodeDelimited = function decodeDelimited(reader) { + MultiSpeakerMarkup.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomPronunciations message. + * Verifies a MultiSpeakerMarkup message. * @function verify - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomPronunciations.verify = function verify(message) { + MultiSpeakerMarkup.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pronunciations != null && message.hasOwnProperty("pronunciations")) { - if (!Array.isArray(message.pronunciations)) - return "pronunciations: array expected"; - for (var i = 0; i < message.pronunciations.length; ++i) { - var error = $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.verify(message.pronunciations[i]); + if (message.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.verify(message.turns[i]); if (error) - return "pronunciations." + error; + return "turns." + error; } } return null; }; /** - * Creates a CustomPronunciations message from a plain object. Also converts values to their respective internal types. + * Creates a MultiSpeakerMarkup message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static * @param {Object.} object Plain object - * @returns {google.cloud.texttospeech.v1beta1.CustomPronunciations} CustomPronunciations + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup} MultiSpeakerMarkup */ - CustomPronunciations.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.texttospeech.v1beta1.CustomPronunciations) + MultiSpeakerMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup) return object; - var message = new $root.google.cloud.texttospeech.v1beta1.CustomPronunciations(); - if (object.pronunciations) { - if (!Array.isArray(object.pronunciations)) - throw TypeError(".google.cloud.texttospeech.v1beta1.CustomPronunciations.pronunciations: array expected"); - message.pronunciations = []; - for (var i = 0; i < object.pronunciations.length; ++i) { - if (typeof object.pronunciations[i] !== "object") - throw TypeError(".google.cloud.texttospeech.v1beta1.CustomPronunciations.pronunciations: object expected"); - message.pronunciations[i] = $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.fromObject(object.pronunciations[i]); + var message = new $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup(); + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.turns: object expected"); + message.turns[i] = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.fromObject(object.turns[i]); } } return message; }; /** - * Creates a plain object from a CustomPronunciations message. Also converts values to other types if specified. + * Creates a plain object from a MultiSpeakerMarkup message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static - * @param {google.cloud.texttospeech.v1beta1.CustomPronunciations} message CustomPronunciations + * @param {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup} message MultiSpeakerMarkup * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomPronunciations.toObject = function toObject(message, options) { + MultiSpeakerMarkup.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pronunciations = []; - if (message.pronunciations && message.pronunciations.length) { - object.pronunciations = []; - for (var j = 0; j < message.pronunciations.length; ++j) - object.pronunciations[j] = $root.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.toObject(message.pronunciations[j], options); + object.turns = []; + if (message.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.toObject(message.turns[j], options); } return object; }; /** - * Converts this CustomPronunciations to JSON. + * Converts this MultiSpeakerMarkup to JSON. * @function toJSON - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @instance * @returns {Object.} JSON object */ - CustomPronunciations.prototype.toJSON = function toJSON() { + MultiSpeakerMarkup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CustomPronunciations + * Gets the default type url for MultiSpeakerMarkup * @function getTypeUrl - * @memberof google.cloud.texttospeech.v1beta1.CustomPronunciations + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CustomPronunciations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MultiSpeakerMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.texttospeech.v1beta1.CustomPronunciations"; - }; + return typeUrlPrefix + "/google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup"; + }; + + MultiSpeakerMarkup.Turn = (function() { + + /** + * Properties of a Turn. + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup + * @interface ITurn + * @property {string|null} [speaker] Turn speaker + * @property {string|null} [text] Turn text + */ + + /** + * Constructs a new Turn. + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup + * @classdesc Represents a Turn. + * @implements ITurn + * @constructor + * @param {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn=} [properties] Properties to set + */ + function Turn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Turn speaker. + * @member {string} speaker + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @instance + */ + Turn.prototype.speaker = ""; + + /** + * Turn text. + * @member {string} text + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @instance + */ + Turn.prototype.text = ""; + + /** + * Creates a new Turn instance using the specified properties. + * @function create + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn} Turn instance + */ + Turn.create = function create(properties) { + return new Turn(properties); + }; + + /** + * Encodes the specified Turn message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @function encode + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speaker != null && Object.hasOwnProperty.call(message, "speaker")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.speaker); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Turn message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.ITurn} message Turn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Turn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Turn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.speaker = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Turn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn} Turn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Turn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Turn message. + * @function verify + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Turn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speaker != null && message.hasOwnProperty("speaker")) + if (!$util.isString(message.speaker)) + return "speaker: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a Turn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn} Turn + */ + Turn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn) + return object; + var message = new $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn(); + if (object.speaker != null) + message.speaker = String(object.speaker); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Turn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn} message Turn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Turn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.speaker = ""; + object.text = ""; + } + if (message.speaker != null && message.hasOwnProperty("speaker")) + object.speaker = message.speaker; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this Turn to JSON. + * @function toJSON + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @instance + * @returns {Object.} JSON object + */ + Turn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Turn + * @function getTypeUrl + * @memberof google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Turn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn"; + }; - return CustomPronunciations; + return Turn; + })(); + + return MultiSpeakerMarkup; })(); v1beta1.SynthesisInput = (function() { @@ -7356,6 +8524,7 @@ * @interface ISynthesisInput * @property {string|null} [text] SynthesisInput text * @property {string|null} [ssml] SynthesisInput ssml + * @property {google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup|null} [multiSpeakerMarkup] SynthesisInput multiSpeakerMarkup * @property {google.cloud.texttospeech.v1beta1.ICustomPronunciations|null} [customPronunciations] SynthesisInput customPronunciations */ @@ -7390,6 +8559,14 @@ */ SynthesisInput.prototype.ssml = null; + /** + * SynthesisInput multiSpeakerMarkup. + * @member {google.cloud.texttospeech.v1beta1.IMultiSpeakerMarkup|null|undefined} multiSpeakerMarkup + * @memberof google.cloud.texttospeech.v1beta1.SynthesisInput + * @instance + */ + SynthesisInput.prototype.multiSpeakerMarkup = null; + /** * SynthesisInput customPronunciations. * @member {google.cloud.texttospeech.v1beta1.ICustomPronunciations|null|undefined} customPronunciations @@ -7403,12 +8580,12 @@ /** * SynthesisInput inputSource. - * @member {"text"|"ssml"|undefined} inputSource + * @member {"text"|"ssml"|"multiSpeakerMarkup"|undefined} inputSource * @memberof google.cloud.texttospeech.v1beta1.SynthesisInput * @instance */ Object.defineProperty(SynthesisInput.prototype, "inputSource", { - get: $util.oneOfGetter($oneOfFields = ["text", "ssml"]), + get: $util.oneOfGetter($oneOfFields = ["text", "ssml", "multiSpeakerMarkup"]), set: $util.oneOfSetter($oneOfFields) }); @@ -7442,6 +8619,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); if (message.customPronunciations != null && Object.hasOwnProperty.call(message, "customPronunciations")) $root.google.cloud.texttospeech.v1beta1.CustomPronunciations.encode(message.customPronunciations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.multiSpeakerMarkup != null && Object.hasOwnProperty.call(message, "multiSpeakerMarkup")) + $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.encode(message.multiSpeakerMarkup, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -7484,6 +8663,10 @@ message.ssml = reader.string(); break; } + case 4: { + message.multiSpeakerMarkup = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.decode(reader, reader.uint32()); + break; + } case 3: { message.customPronunciations = $root.google.cloud.texttospeech.v1beta1.CustomPronunciations.decode(reader, reader.uint32()); break; @@ -7536,6 +8719,16 @@ if (!$util.isString(message.ssml)) return "ssml: string expected"; } + if (message.multiSpeakerMarkup != null && message.hasOwnProperty("multiSpeakerMarkup")) { + if (properties.inputSource === 1) + return "inputSource: multiple values"; + properties.inputSource = 1; + { + var error = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.verify(message.multiSpeakerMarkup); + if (error) + return "multiSpeakerMarkup." + error; + } + } if (message.customPronunciations != null && message.hasOwnProperty("customPronunciations")) { var error = $root.google.cloud.texttospeech.v1beta1.CustomPronunciations.verify(message.customPronunciations); if (error) @@ -7560,6 +8753,11 @@ message.text = String(object.text); if (object.ssml != null) message.ssml = String(object.ssml); + if (object.multiSpeakerMarkup != null) { + if (typeof object.multiSpeakerMarkup !== "object") + throw TypeError(".google.cloud.texttospeech.v1beta1.SynthesisInput.multiSpeakerMarkup: object expected"); + message.multiSpeakerMarkup = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.fromObject(object.multiSpeakerMarkup); + } if (object.customPronunciations != null) { if (typeof object.customPronunciations !== "object") throw TypeError(".google.cloud.texttospeech.v1beta1.SynthesisInput.customPronunciations: object expected"); @@ -7595,6 +8793,11 @@ } if (message.customPronunciations != null && message.hasOwnProperty("customPronunciations")) object.customPronunciations = $root.google.cloud.texttospeech.v1beta1.CustomPronunciations.toObject(message.customPronunciations, options); + if (message.multiSpeakerMarkup != null && message.hasOwnProperty("multiSpeakerMarkup")) { + object.multiSpeakerMarkup = $root.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.toObject(message.multiSpeakerMarkup, options); + if (options.oneofs) + object.inputSource = "multiSpeakerMarkup"; + } return object; }; @@ -7637,6 +8840,7 @@ * @property {string|null} [name] VoiceSelectionParams name * @property {google.cloud.texttospeech.v1beta1.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender * @property {google.cloud.texttospeech.v1beta1.ICustomVoiceParams|null} [customVoice] VoiceSelectionParams customVoice + * @property {google.cloud.texttospeech.v1beta1.IVoiceCloneParams|null} [voiceClone] VoiceSelectionParams voiceClone */ /** @@ -7686,6 +8890,14 @@ */ VoiceSelectionParams.prototype.customVoice = null; + /** + * VoiceSelectionParams voiceClone. + * @member {google.cloud.texttospeech.v1beta1.IVoiceCloneParams|null|undefined} voiceClone + * @memberof google.cloud.texttospeech.v1beta1.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.voiceClone = null; + /** * Creates a new VoiceSelectionParams instance using the specified properties. * @function create @@ -7718,6 +8930,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ssmlGender); if (message.customVoice != null && Object.hasOwnProperty.call(message, "customVoice")) $root.google.cloud.texttospeech.v1beta1.CustomVoiceParams.encode(message.customVoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.voiceClone != null && Object.hasOwnProperty.call(message, "voiceClone")) + $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams.encode(message.voiceClone, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -7768,6 +8982,10 @@ message.customVoice = $root.google.cloud.texttospeech.v1beta1.CustomVoiceParams.decode(reader, reader.uint32()); break; } + case 5: { + message.voiceClone = $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7824,6 +9042,11 @@ if (error) return "customVoice." + error; } + if (message.voiceClone != null && message.hasOwnProperty("voiceClone")) { + var error = $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams.verify(message.voiceClone); + if (error) + return "voiceClone." + error; + } return null; }; @@ -7872,6 +9095,11 @@ throw TypeError(".google.cloud.texttospeech.v1beta1.VoiceSelectionParams.customVoice: object expected"); message.customVoice = $root.google.cloud.texttospeech.v1beta1.CustomVoiceParams.fromObject(object.customVoice); } + if (object.voiceClone != null) { + if (typeof object.voiceClone !== "object") + throw TypeError(".google.cloud.texttospeech.v1beta1.VoiceSelectionParams.voiceClone: object expected"); + message.voiceClone = $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams.fromObject(object.voiceClone); + } return message; }; @@ -7893,6 +9121,7 @@ object.name = ""; object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; object.customVoice = null; + object.voiceClone = null; } if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; @@ -7902,6 +9131,8 @@ object.ssmlGender = options.enums === String ? $root.google.cloud.texttospeech.v1beta1.SsmlVoiceGender[message.ssmlGender] === undefined ? message.ssmlGender : $root.google.cloud.texttospeech.v1beta1.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; if (message.customVoice != null && message.hasOwnProperty("customVoice")) object.customVoice = $root.google.cloud.texttospeech.v1beta1.CustomVoiceParams.toObject(message.customVoice, options); + if (message.voiceClone != null && message.hasOwnProperty("voiceClone")) + object.voiceClone = $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams.toObject(message.voiceClone, options); return object; }; @@ -8581,6 +9812,209 @@ return CustomVoiceParams; })(); + v1beta1.VoiceCloneParams = (function() { + + /** + * Properties of a VoiceCloneParams. + * @memberof google.cloud.texttospeech.v1beta1 + * @interface IVoiceCloneParams + * @property {string|null} [voiceCloningKey] VoiceCloneParams voiceCloningKey + */ + + /** + * Constructs a new VoiceCloneParams. + * @memberof google.cloud.texttospeech.v1beta1 + * @classdesc Represents a VoiceCloneParams. + * @implements IVoiceCloneParams + * @constructor + * @param {google.cloud.texttospeech.v1beta1.IVoiceCloneParams=} [properties] Properties to set + */ + function VoiceCloneParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceCloneParams voiceCloningKey. + * @member {string} voiceCloningKey + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @instance + */ + VoiceCloneParams.prototype.voiceCloningKey = ""; + + /** + * Creates a new VoiceCloneParams instance using the specified properties. + * @function create + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1beta1.IVoiceCloneParams=} [properties] Properties to set + * @returns {google.cloud.texttospeech.v1beta1.VoiceCloneParams} VoiceCloneParams instance + */ + VoiceCloneParams.create = function create(properties) { + return new VoiceCloneParams(properties); + }; + + /** + * Encodes the specified VoiceCloneParams message. Does not implicitly {@link google.cloud.texttospeech.v1beta1.VoiceCloneParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1beta1.IVoiceCloneParams} message VoiceCloneParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceCloneParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceCloningKey != null && Object.hasOwnProperty.call(message, "voiceCloningKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceCloningKey); + return writer; + }; + + /** + * Encodes the specified VoiceCloneParams message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1beta1.VoiceCloneParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1beta1.IVoiceCloneParams} message VoiceCloneParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceCloneParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.texttospeech.v1beta1.VoiceCloneParams} VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceCloneParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceCloningKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceCloneParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.texttospeech.v1beta1.VoiceCloneParams} VoiceCloneParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceCloneParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceCloneParams message. + * @function verify + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceCloneParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voiceCloningKey != null && message.hasOwnProperty("voiceCloningKey")) + if (!$util.isString(message.voiceCloningKey)) + return "voiceCloningKey: string expected"; + return null; + }; + + /** + * Creates a VoiceCloneParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.texttospeech.v1beta1.VoiceCloneParams} VoiceCloneParams + */ + VoiceCloneParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams) + return object; + var message = new $root.google.cloud.texttospeech.v1beta1.VoiceCloneParams(); + if (object.voiceCloningKey != null) + message.voiceCloningKey = String(object.voiceCloningKey); + return message; + }; + + /** + * Creates a plain object from a VoiceCloneParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {google.cloud.texttospeech.v1beta1.VoiceCloneParams} message VoiceCloneParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceCloneParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.voiceCloningKey = ""; + if (message.voiceCloningKey != null && message.hasOwnProperty("voiceCloningKey")) + object.voiceCloningKey = message.voiceCloningKey; + return object; + }; + + /** + * Converts this VoiceCloneParams to JSON. + * @function toJSON + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @instance + * @returns {Object.} JSON object + */ + VoiceCloneParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceCloneParams + * @function getTypeUrl + * @memberof google.cloud.texttospeech.v1beta1.VoiceCloneParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceCloneParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.texttospeech.v1beta1.VoiceCloneParams"; + }; + + return VoiceCloneParams; + })(); + v1beta1.SynthesizeSpeechResponse = (function() { /** diff --git a/packages/google-cloud-texttospeech/protos/protos.json b/packages/google-cloud-texttospeech/protos/protos.json index 16368d07d6a..67d7e902460 100644 --- a/packages/google-cloud-texttospeech/protos/protos.json +++ b/packages/google-cloud-texttospeech/protos/protos.json @@ -11,7 +11,6 @@ "nested": { "v1": { "options": { - "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.TextToSpeech.V1", "go_package": "cloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb", "java_multiple_files": true, @@ -252,12 +251,45 @@ } } }, + "MultiSpeakerMarkup": { + "fields": { + "turns": { + "rule": "repeated", + "type": "Turn", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Turn": { + "fields": { + "speaker": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "text": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "SynthesisInput": { "oneofs": { "inputSource": { "oneof": [ "text", - "ssml" + "ssml", + "multiSpeakerMarkup" ] } }, @@ -270,6 +302,10 @@ "type": "string", "id": 2 }, + "multiSpeakerMarkup": { + "type": "MultiSpeakerMarkup", + "id": 4 + }, "customPronunciations": { "type": "CustomPronunciations", "id": 3, @@ -299,6 +335,13 @@ "customVoice": { "type": "CustomVoiceParams", "id": 4 + }, + "voiceClone": { + "type": "VoiceCloneParams", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -378,6 +421,17 @@ } } }, + "VoiceCloneParams": { + "fields": { + "voiceCloningKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "SynthesizeSpeechResponse": { "fields": { "audioContent": { @@ -534,7 +588,6 @@ }, "v1beta1": { "options": { - "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.TextToSpeech.V1Beta1", "go_package": "cloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb", "java_multiple_files": true, @@ -789,12 +842,45 @@ } } }, + "MultiSpeakerMarkup": { + "fields": { + "turns": { + "rule": "repeated", + "type": "Turn", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Turn": { + "fields": { + "speaker": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "text": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "SynthesisInput": { "oneofs": { "inputSource": { "oneof": [ "text", - "ssml" + "ssml", + "multiSpeakerMarkup" ] } }, @@ -807,6 +893,10 @@ "type": "string", "id": 2 }, + "multiSpeakerMarkup": { + "type": "MultiSpeakerMarkup", + "id": 4 + }, "customPronunciations": { "type": "CustomPronunciations", "id": 3, @@ -836,6 +926,13 @@ "customVoice": { "type": "CustomVoiceParams", "id": 4 + }, + "voiceClone": { + "type": "VoiceCloneParams", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -915,6 +1012,17 @@ } } }, + "VoiceCloneParams": { + "fields": { + "voiceCloningKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "SynthesizeSpeechResponse": { "fields": { "audioContent": {