@google-cloud/text-to-speech
Version:
Cloud Text-to-Speech API client for Node.js
903 lines (753 loc) • 705 kB
TypeScript
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import type {protobuf as $protobuf} from "google-gax";
import Long = require("long");
/** Namespace google. */
export namespace google {
/** Namespace cloud. */
namespace cloud {
/** Namespace texttospeech. */
namespace texttospeech {
/** Namespace v1. */
namespace v1 {
/** Represents a TextToSpeech */
class TextToSpeech extends $protobuf.rpc.Service {
/**
* Constructs a new TextToSpeech service.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
*/
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
/**
* Creates new TextToSpeech service using the specified rpc implementation.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
* @returns RPC service. Useful where requests and/or responses are streamed.
*/
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TextToSpeech;
/**
* Calls ListVoices.
* @param request ListVoicesRequest message or plain object
* @param callback Node-style callback called with the error, if any, and ListVoicesResponse
*/
public listVoices(request: google.cloud.texttospeech.v1.IListVoicesRequest, callback: google.cloud.texttospeech.v1.TextToSpeech.ListVoicesCallback): void;
/**
* Calls ListVoices.
* @param request ListVoicesRequest message or plain object
* @returns Promise
*/
public listVoices(request: google.cloud.texttospeech.v1.IListVoicesRequest): Promise<google.cloud.texttospeech.v1.ListVoicesResponse>;
/**
* Calls SynthesizeSpeech.
* @param request SynthesizeSpeechRequest message or plain object
* @param callback Node-style callback called with the error, if any, and SynthesizeSpeechResponse
*/
public synthesizeSpeech(request: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, callback: google.cloud.texttospeech.v1.TextToSpeech.SynthesizeSpeechCallback): void;
/**
* Calls SynthesizeSpeech.
* @param request SynthesizeSpeechRequest message or plain object
* @returns Promise
*/
public synthesizeSpeech(request: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest): Promise<google.cloud.texttospeech.v1.SynthesizeSpeechResponse>;
/**
* Calls StreamingSynthesize.
* @param request StreamingSynthesizeRequest message or plain object
* @param callback Node-style callback called with the error, if any, and StreamingSynthesizeResponse
*/
public streamingSynthesize(request: google.cloud.texttospeech.v1.IStreamingSynthesizeRequest, callback: google.cloud.texttospeech.v1.TextToSpeech.StreamingSynthesizeCallback): void;
/**
* Calls StreamingSynthesize.
* @param request StreamingSynthesizeRequest message or plain object
* @returns Promise
*/
public streamingSynthesize(request: google.cloud.texttospeech.v1.IStreamingSynthesizeRequest): Promise<google.cloud.texttospeech.v1.StreamingSynthesizeResponse>;
}
namespace TextToSpeech {
/**
* Callback as used by {@link google.cloud.texttospeech.v1.TextToSpeech|listVoices}.
* @param error Error, if any
* @param [response] ListVoicesResponse
*/
type ListVoicesCallback = (error: (Error|null), response?: google.cloud.texttospeech.v1.ListVoicesResponse) => void;
/**
* Callback as used by {@link google.cloud.texttospeech.v1.TextToSpeech|synthesizeSpeech}.
* @param error Error, if any
* @param [response] SynthesizeSpeechResponse
*/
type SynthesizeSpeechCallback = (error: (Error|null), response?: google.cloud.texttospeech.v1.SynthesizeSpeechResponse) => void;
/**
* Callback as used by {@link google.cloud.texttospeech.v1.TextToSpeech|streamingSynthesize}.
* @param error Error, if any
* @param [response] StreamingSynthesizeResponse
*/
type StreamingSynthesizeCallback = (error: (Error|null), response?: google.cloud.texttospeech.v1.StreamingSynthesizeResponse) => void;
}
/** SsmlVoiceGender enum. */
enum SsmlVoiceGender {
SSML_VOICE_GENDER_UNSPECIFIED = 0,
MALE = 1,
FEMALE = 2,
NEUTRAL = 3
}
/** AudioEncoding enum. */
enum AudioEncoding {
AUDIO_ENCODING_UNSPECIFIED = 0,
LINEAR16 = 1,
MP3 = 2,
OGG_OPUS = 3,
MULAW = 5,
ALAW = 6,
PCM = 7,
M4A = 8
}
/** Properties of a ListVoicesRequest. */
interface IListVoicesRequest {
/** ListVoicesRequest languageCode */
languageCode?: (string|null);
}
/** Represents a ListVoicesRequest. */
class ListVoicesRequest implements IListVoicesRequest {
/**
* Constructs a new ListVoicesRequest.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.IListVoicesRequest);
/** ListVoicesRequest languageCode. */
public languageCode: string;
/**
* Creates a new ListVoicesRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns ListVoicesRequest instance
*/
public static create(properties?: google.cloud.texttospeech.v1.IListVoicesRequest): google.cloud.texttospeech.v1.ListVoicesRequest;
/**
* Encodes the specified ListVoicesRequest message. Does not implicitly {@link google.cloud.texttospeech.v1.ListVoicesRequest.verify|verify} messages.
* @param message ListVoicesRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.IListVoicesRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified ListVoicesRequest message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.ListVoicesRequest.verify|verify} messages.
* @param message ListVoicesRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.IListVoicesRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a ListVoicesRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns ListVoicesRequest
* @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.ListVoicesRequest;
/**
* Decodes a ListVoicesRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns ListVoicesRequest
* @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.ListVoicesRequest;
/**
* Verifies a ListVoicesRequest 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 ListVoicesRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns ListVoicesRequest
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.ListVoicesRequest;
/**
* Creates a plain object from a ListVoicesRequest message. Also converts values to other types if specified.
* @param message ListVoicesRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.ListVoicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this ListVoicesRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for ListVoicesRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a ListVoicesResponse. */
interface IListVoicesResponse {
/** ListVoicesResponse voices */
voices?: (google.cloud.texttospeech.v1.IVoice[]|null);
}
/** Represents a ListVoicesResponse. */
class ListVoicesResponse implements IListVoicesResponse {
/**
* Constructs a new ListVoicesResponse.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.IListVoicesResponse);
/** ListVoicesResponse voices. */
public voices: google.cloud.texttospeech.v1.IVoice[];
/**
* Creates a new ListVoicesResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns ListVoicesResponse instance
*/
public static create(properties?: google.cloud.texttospeech.v1.IListVoicesResponse): google.cloud.texttospeech.v1.ListVoicesResponse;
/**
* Encodes the specified ListVoicesResponse message. Does not implicitly {@link google.cloud.texttospeech.v1.ListVoicesResponse.verify|verify} messages.
* @param message ListVoicesResponse message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.IListVoicesResponse, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified ListVoicesResponse message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.ListVoicesResponse.verify|verify} messages.
* @param message ListVoicesResponse message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.IListVoicesResponse, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a ListVoicesResponse message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns ListVoicesResponse
* @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.ListVoicesResponse;
/**
* Decodes a ListVoicesResponse message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns ListVoicesResponse
* @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.ListVoicesResponse;
/**
* Verifies a ListVoicesResponse 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 ListVoicesResponse message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns ListVoicesResponse
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.ListVoicesResponse;
/**
* Creates a plain object from a ListVoicesResponse message. Also converts values to other types if specified.
* @param message ListVoicesResponse
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.ListVoicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this ListVoicesResponse to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for ListVoicesResponse
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a Voice. */
interface IVoice {
/** Voice languageCodes */
languageCodes?: (string[]|null);
/** Voice name */
name?: (string|null);
/** Voice ssmlGender */
ssmlGender?: (google.cloud.texttospeech.v1.SsmlVoiceGender|keyof typeof google.cloud.texttospeech.v1.SsmlVoiceGender|null);
/** Voice naturalSampleRateHertz */
naturalSampleRateHertz?: (number|null);
}
/** Represents a Voice. */
class Voice implements IVoice {
/**
* Constructs a new Voice.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.IVoice);
/** Voice languageCodes. */
public languageCodes: string[];
/** Voice name. */
public name: string;
/** Voice ssmlGender. */
public ssmlGender: (google.cloud.texttospeech.v1.SsmlVoiceGender|keyof typeof google.cloud.texttospeech.v1.SsmlVoiceGender);
/** Voice naturalSampleRateHertz. */
public naturalSampleRateHertz: number;
/**
* Creates a new Voice instance using the specified properties.
* @param [properties] Properties to set
* @returns Voice instance
*/
public static create(properties?: google.cloud.texttospeech.v1.IVoice): google.cloud.texttospeech.v1.Voice;
/**
* Encodes the specified Voice message. Does not implicitly {@link google.cloud.texttospeech.v1.Voice.verify|verify} messages.
* @param message Voice message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.IVoice, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified Voice message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.Voice.verify|verify} messages.
* @param message Voice message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.IVoice, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a Voice message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Voice
* @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.Voice;
/**
* Decodes a Voice message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Voice
* @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.Voice;
/**
* Verifies a Voice 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 Voice message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Voice
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.Voice;
/**
* Creates a plain object from a Voice message. Also converts values to other types if specified.
* @param message Voice
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.Voice, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this Voice to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for Voice
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of an AdvancedVoiceOptions. */
interface IAdvancedVoiceOptions {
/** AdvancedVoiceOptions lowLatencyJourneySynthesis */
lowLatencyJourneySynthesis?: (boolean|null);
/** AdvancedVoiceOptions relaxSafetyFilters */
relaxSafetyFilters?: (boolean|null);
/** AdvancedVoiceOptions safetySettings */
safetySettings?: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySettings|null);
/** AdvancedVoiceOptions enableTextnorm */
enableTextnorm?: (boolean|null);
}
/** Represents an AdvancedVoiceOptions. */
class AdvancedVoiceOptions implements IAdvancedVoiceOptions {
/**
* Constructs a new AdvancedVoiceOptions.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.IAdvancedVoiceOptions);
/** AdvancedVoiceOptions lowLatencyJourneySynthesis. */
public lowLatencyJourneySynthesis?: (boolean|null);
/** AdvancedVoiceOptions relaxSafetyFilters. */
public relaxSafetyFilters: boolean;
/** AdvancedVoiceOptions safetySettings. */
public safetySettings?: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySettings|null);
/** AdvancedVoiceOptions enableTextnorm. */
public enableTextnorm?: (boolean|null);
/**
* Creates a new AdvancedVoiceOptions instance using the specified properties.
* @param [properties] Properties to set
* @returns AdvancedVoiceOptions instance
*/
public static create(properties?: google.cloud.texttospeech.v1.IAdvancedVoiceOptions): google.cloud.texttospeech.v1.AdvancedVoiceOptions;
/**
* Encodes the specified AdvancedVoiceOptions message. Does not implicitly {@link google.cloud.texttospeech.v1.AdvancedVoiceOptions.verify|verify} messages.
* @param message AdvancedVoiceOptions message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.IAdvancedVoiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified AdvancedVoiceOptions message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.AdvancedVoiceOptions.verify|verify} messages.
* @param message AdvancedVoiceOptions message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.IAdvancedVoiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes an AdvancedVoiceOptions message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns AdvancedVoiceOptions
* @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.AdvancedVoiceOptions;
/**
* Decodes an AdvancedVoiceOptions message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns AdvancedVoiceOptions
* @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.AdvancedVoiceOptions;
/**
* Verifies an AdvancedVoiceOptions 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 an AdvancedVoiceOptions message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns AdvancedVoiceOptions
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.AdvancedVoiceOptions;
/**
* Creates a plain object from an AdvancedVoiceOptions message. Also converts values to other types if specified.
* @param message AdvancedVoiceOptions
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this AdvancedVoiceOptions to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for AdvancedVoiceOptions
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace AdvancedVoiceOptions {
/** Properties of a SafetySetting. */
interface ISafetySetting {
/** SafetySetting category */
category?: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory|keyof typeof google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory|null);
/** SafetySetting threshold */
threshold?: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold|keyof typeof google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold|null);
}
/** Represents a SafetySetting. */
class SafetySetting implements ISafetySetting {
/**
* Constructs a new SafetySetting.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySetting);
/** SafetySetting category. */
public category: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory|keyof typeof google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmCategory);
/** SafetySetting threshold. */
public threshold: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold|keyof typeof google.cloud.texttospeech.v1.AdvancedVoiceOptions.HarmBlockThreshold);
/**
* Creates a new SafetySetting instance using the specified properties.
* @param [properties] Properties to set
* @returns SafetySetting instance
*/
public static create(properties?: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySetting): google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting;
/**
* Encodes the specified SafetySetting message. Does not implicitly {@link google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting.verify|verify} messages.
* @param message SafetySetting message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting.verify|verify} messages.
* @param message SafetySetting message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a SafetySetting message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns SafetySetting
* @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.AdvancedVoiceOptions.SafetySetting;
/**
* Decodes a SafetySetting message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SafetySetting
* @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.AdvancedVoiceOptions.SafetySetting;
/**
* Verifies a SafetySetting 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 SafetySetting message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns SafetySetting
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting;
/**
* Creates a plain object from a SafetySetting message. Also converts values to other types if specified.
* @param message SafetySetting
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this SafetySetting to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for SafetySetting
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a SafetySettings. */
interface ISafetySettings {
/** SafetySettings settings */
settings?: (google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySetting[]|null);
}
/** Represents a SafetySettings. */
class SafetySettings implements ISafetySettings {
/**
* Constructs a new SafetySettings.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySettings);
/** SafetySettings settings. */
public settings: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySetting[];
/**
* Creates a new SafetySettings instance using the specified properties.
* @param [properties] Properties to set
* @returns SafetySettings instance
*/
public static create(properties?: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySettings): google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings;
/**
* Encodes the specified SafetySettings message. Does not implicitly {@link google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings.verify|verify} messages.
* @param message SafetySettings message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySettings, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified SafetySettings message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings.verify|verify} messages.
* @param message SafetySettings message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions.ISafetySettings, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a SafetySettings message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns SafetySettings
* @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.AdvancedVoiceOptions.SafetySettings;
/**
* Decodes a SafetySettings message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SafetySettings
* @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.AdvancedVoiceOptions.SafetySettings;
/**
* Verifies a SafetySettings 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 SafetySettings message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns SafetySettings
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings;
/**
* Creates a plain object from a SafetySettings message. Also converts values to other types if specified.
* @param message SafetySettings
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.AdvancedVoiceOptions.SafetySettings, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this SafetySettings to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for SafetySettings
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** HarmCategory enum. */
enum HarmCategory {
HARM_CATEGORY_UNSPECIFIED = 0,
HARM_CATEGORY_HATE_SPEECH = 1,
HARM_CATEGORY_DANGEROUS_CONTENT = 2,
HARM_CATEGORY_HARASSMENT = 3,
HARM_CATEGORY_SEXUALLY_EXPLICIT = 4
}
/** HarmBlockThreshold enum. */
enum HarmBlockThreshold {
HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0,
BLOCK_LOW_AND_ABOVE = 1,
BLOCK_MEDIUM_AND_ABOVE = 2,
BLOCK_ONLY_HIGH = 3,
BLOCK_NONE = 4,
OFF = 5
}
}
/** Properties of a SynthesizeSpeechRequest. */
interface ISynthesizeSpeechRequest {
/** SynthesizeSpeechRequest input */
input?: (google.cloud.texttospeech.v1.ISynthesisInput|null);
/** SynthesizeSpeechRequest voice */
voice?: (google.cloud.texttospeech.v1.IVoiceSelectionParams|null);
/** SynthesizeSpeechRequest audioConfig */
audioConfig?: (google.cloud.texttospeech.v1.IAudioConfig|null);
/** SynthesizeSpeechRequest advancedVoiceOptions */
advancedVoiceOptions?: (google.cloud.texttospeech.v1.IAdvancedVoiceOptions|null);
}
/** Represents a SynthesizeSpeechRequest. */
class SynthesizeSpeechRequest implements ISynthesizeSpeechRequest {
/**
* Constructs a new SynthesizeSpeechRequest.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest);
/** SynthesizeSpeechRequest input. */
public input?: (google.cloud.texttospeech.v1.ISynthesisInput|null);
/** SynthesizeSpeechRequest voice. */
public voice?: (google.cloud.texttospeech.v1.IVoiceSelectionParams|null);
/** SynthesizeSpeechRequest audioConfig. */
public audioConfig?: (google.cloud.texttospeech.v1.IAudioConfig|null);
/** SynthesizeSpeechRequest advancedVoiceOptions. */
public advancedVoiceOptions?: (google.cloud.texttospeech.v1.IAdvancedVoiceOptions|null);
/**
* Creates a new SynthesizeSpeechRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns SynthesizeSpeechRequest instance
*/
public static create(properties?: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest): google.cloud.texttospeech.v1.SynthesizeSpeechRequest;
/**
* Encodes the specified SynthesizeSpeechRequest message. Does not implicitly {@link google.cloud.texttospeech.v1.SynthesizeSpeechRequest.verify|verify} messages.
* @param message SynthesizeSpeechRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified SynthesizeSpeechRequest message, length delimited. Does not implicitly {@link google.cloud.texttospeech.v1.SynthesizeSpeechRequest.verify|verify} messages.
* @param message SynthesizeSpeechRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a SynthesizeSpeechRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns SynthesizeSpeechRequest
* @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.SynthesizeSpeechRequest;
/**
* Decodes a SynthesizeSpeechRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns SynthesizeSpeechRequest
* @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.SynthesizeSpeechRequest;
/**
* Verifies a SynthesizeSpeechRequest 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 SynthesizeSpeechRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns SynthesizeSpeechRequest
*/
public static fromObject(object: { [k: string]: any }): google.cloud.texttospeech.v1.SynthesizeSpeechRequest;
/**
* Creates a plain object from a SynthesizeSpeechRequest message. Also converts values to other types if specified.
* @param message SynthesizeSpeechRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.texttospeech.v1.SynthesizeSpeechRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this SynthesizeSpeechRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for SynthesizeSpeechRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a CustomPronunciationParams. */
interface ICustomPronunciationParams {
/** CustomPronunciationParams phrase */
phrase?: (string|null);
/** CustomPronunciationParams