New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@maxim_mazurok/gapi.client.texttospeech-v1beta1

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maxim_mazurok/gapi.client.texttospeech-v1beta1 - npm Package Compare versions

Comparing version 0.0.20231113 to 0.0.20231130

874

index.d.ts

@@ -12,3 +12,3 @@ /* Type definitions for non-npm package Cloud Text-to-Speech API v1beta1 0.0 */

// Generated from: https://texttospeech.googleapis.com/$discovery/rest?version=v1beta1
// Revision: 20231113
// Revision: 20231130

@@ -18,528 +18,356 @@ /// <reference types="gapi.client" />

declare namespace gapi.client {
/** Load Cloud Text-to-Speech API v1beta1 */
function load(urlOrObject: "https://texttospeech.googleapis.com/$discovery/rest?version=v1beta1"): Promise<void>;
/** @deprecated Please load APIs with discovery documents. */
function load(name: "texttospeech", version: "v1beta1"): Promise<void>;
/** @deprecated Please load APIs with discovery documents. */
function load(name: "texttospeech", version: "v1beta1", callback: () => any): void;
/** Load Cloud Text-to-Speech API v1beta1 */
function load(
urlOrObject: 'https://texttospeech.googleapis.com/$discovery/rest?version=v1beta1'
): Promise<void>;
/** @deprecated Please load APIs with discovery documents. */
function load(name: 'texttospeech', version: 'v1beta1'): Promise<void>;
/** @deprecated Please load APIs with discovery documents. */
function load(
name: 'texttospeech',
version: 'v1beta1',
callback: () => any
): void;
namespace texttospeech {
interface AudioConfig {
/** Required. The format of the audio byte stream. */
audioEncoding?:
string;
/**
* Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the
* order they are given. See [audio profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for current supported profile ids.
*/
effectsProfileId?:
string[];
/** Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch. */
pitch?:
number;
/**
* Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the
* synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the
* encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT.
*/
sampleRateHertz?:
number;
/**
* Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast.
* If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error.
*/
speakingRate?:
number;
/**
* Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play
* at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at
* approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value
* greater than that.
*/
volumeGainDb?:
number;
}
interface CustomVoiceParams {
/** Required. The name of the AutoML model that synthesizes the custom voice. */
model?:
string;
/** Optional. Deprecated. The usage of the synthesized audio to be reported. */
reportedUsage?:
string;
}
interface GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata {
/** The progress of the most recent processing update in percentage, ie. 70.0%. */
progressPercentage?:
number;
/** Time when the request was received. */
startTime?:
string;
}
interface ListOperationsResponse {
/** The standard List next-page token. */
nextPageToken?:
string;
/** A list of operations that matches the specified filter in the request. */
operations?:
Operation[];
}
interface ListVoicesResponse {
/** The list of voices. */
voices?:
Voice[];
}
interface Operation {
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
done?:
boolean;
/** The error result of the operation in case of failure or cancellation. */
error?:
Status;
/**
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such
* metadata. Any method that returns a long-running operation should document the metadata type, if any.
*/
metadata?:
{ [P in string]: any };
/**
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending
* with `operations/{unique_id}`.
*/
name?:
string;
/**
* The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original
* method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original
* method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
*/
response?:
{ [P in string]: any };
}
interface Status {
/** The status code, which should be an enum value of google.rpc.Code. */
code?:
number;
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
details?:
Array<{ [P in string]: any }>;
/**
* A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the
* client.
*/
message?:
string;
}
interface SynthesisInput {
/**
* The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information,
* see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
*/
ssml?:
string;
/** The raw text to be synthesized. */
text?:
string;
}
interface SynthesizeLongAudioMetadata {
/** The progress of the most recent processing update in percentage, ie. 70.0%. */
progressPercentage?:
number;
/** Time when the request was received. */
startTime?:
string;
}
interface SynthesizeLongAudioRequest {
/** Required. The configuration of the synthesized audio. */
audioConfig?:
AudioConfig;
/** Required. The Synthesizer requires either plain text or SSML as input. While Long Audio is in preview, SSML is temporarily unsupported. */
input?:
SynthesisInput;
/** Required. Specifies a Cloud Storage URI for the synthesis results. Must be specified in the format: `gs://bucket_name/object_name`, and the bucket must already exist. */
outputGcsUri?:
string;
/** Required. The desired voice of the synthesized audio. */
voice?:
VoiceSelectionParams;
}
interface SynthesizeSpeechRequest {
/** Required. The configuration of the synthesized audio. */
audioConfig?:
AudioConfig;
/** Whether and what timepoints are returned in the response. */
enableTimePointing?:
string[];
/** Required. The Synthesizer requires either plain text or SSML as input. */
input?:
SynthesisInput;
/** Required. The desired voice of the synthesized audio. */
voice?:
VoiceSelectionParams;
}
interface SynthesizeSpeechResponse {
/** The audio metadata of `audio_content`. */
audioConfig?:
AudioConfig;
/**
* The audio data bytes encoded as specified in the request, including the header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). For LINEAR16 audio, we include the
* WAV header. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.
*/
audioContent?:
string;
/** A link between a position in the original request input and a corresponding time in the output audio. It's only supported via `` of SSML input. */
timepoints?:
Timepoint[];
}
interface Timepoint {
/** Timepoint name as received from the client within `` tag. */
markName?:
string;
/** Time offset in seconds from the start of the synthesized audio. */
timeSeconds?:
number;
}
interface Voice {
/** The languages that this voice supports, expressed as [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. "en-US", "es-419", "cmn-tw"). */
languageCodes?:
string[];
/** The name of this voice. Each distinct voice has a unique name. */
name?:
string;
/** The natural sample rate (in hertz) for this voice. */
naturalSampleRateHertz?:
number;
/** The gender of this voice. */
ssmlGender?:
string;
}
interface VoiceSelectionParams {
/** The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration. */
customVoice?:
CustomVoiceParams;
/**
* Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. "en-US". This should
* not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use
* this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a
* different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no"
* (Norwegian)".
*/
languageCode?:
string;
/** The name of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and gender. */
name?:
string;
/**
* The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not
* requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.
*/
ssmlGender?:
string;
}
interface OperationsResource {
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
get(request?: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/** The name of the operation resource. */
name:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
}): Request<Operation>;
/** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
list(request?: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** The standard list filter. */
filter?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/** The name of the operation's parent resource. */
name:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** The standard list page size. */
pageSize?:
number;
/** The standard list page token. */
pageToken?:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
}): Request<ListOperationsResponse>;
}
interface LocationsResource {
/** Synthesizes long form text asynchronously. */
synthesizeLongAudio(request: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** The resource states of the request in the form of `projects/*‍/locations/*`. */
parent:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
/** Request body */
resource:
SynthesizeLongAudioRequest;
}): Request<Operation>;
synthesizeLongAudio(request: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** The resource states of the request in the form of `projects/*‍/locations/*`. */
parent:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
},
body: SynthesizeLongAudioRequest): Request<Operation>;
operations:
OperationsResource;
}
interface ProjectsResource {
locations:
LocationsResource;
}
interface TextResource {
/** Synthesizes speech synchronously: receive results after all text input has been processed. */
synthesize(request: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
/** Request body */
resource:
SynthesizeSpeechRequest;
}): Request<SynthesizeSpeechResponse>;
synthesize(request: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
},
body: SynthesizeSpeechRequest): Request<SynthesizeSpeechResponse>;
}
interface VoicesResource {
/** Returns a list of Voice supported for synthesis. */
list(request?: {
/** V1 error format. */
"$.xgafv"?:
string;
/** OAuth access token. */
access_token?:
string;
/** Data format for response. */
alt?:
string;
/** JSONP */
callback?:
string;
/** Selector specifying which fields to include in a partial response. */
fields?:
string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?:
string;
/**
* Optional. Recommended. [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not specified, the API will return all supported voices. If specified, the
* ListVoices call will only return voices that can be used to synthesize this language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices will be returned. If you
* specify `"no"`, both `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be returned.
*/
languageCode?:
string;
/** OAuth 2.0 token for the current user. */
oauth_token?:
string;
/** Returns response with indentations and line breaks. */
prettyPrint?:
boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?:
string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?:
string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?:
string;
}): Request<ListVoicesResponse>;
}
namespace texttospeech {
interface AudioConfig {
/** Required. The format of the audio byte stream. */
audioEncoding?: string;
/** Optional. Input only. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given. See [audio profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for current supported profile ids. */
effectsProfileId?: string[];
/** Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch. */
pitch?: number;
/** Optional. The synthesis sample rate (in hertz) for this audio. When this is specified in SynthesizeSpeechRequest, if this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality), unless the specified sample rate is not supported for the encoding chosen, in which case it will fail the request and return google.rpc.Code.INVALID_ARGUMENT. */
sampleRateHertz?: number;
/** Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error. */
speakingRate?: number;
/** Optional. Input only. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. Strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that. */
volumeGainDb?: number;
}
interface CustomVoiceParams {
/** Required. The name of the AutoML model that synthesizes the custom voice. */
model?: string;
/** Optional. Deprecated. The usage of the synthesized audio to be reported. */
reportedUsage?: string;
}
interface GoogleCloudTexttospeechV1beta1SynthesizeLongAudioMetadata {
/** The progress of the most recent processing update in percentage, ie. 70.0%. */
progressPercentage?: number;
/** Time when the request was received. */
startTime?: string;
}
interface ListOperationsResponse {
/** The standard List next-page token. */
nextPageToken?: string;
/** A list of operations that matches the specified filter in the request. */
operations?: Operation[];
}
interface ListVoicesResponse {
/** The list of voices. */
voices?: Voice[];
}
interface Operation {
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
done?: boolean;
/** The error result of the operation in case of failure or cancellation. */
error?: Status;
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
metadata?: {[P in string]: any};
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
name?: string;
/** The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */
response?: {[P in string]: any};
}
interface Status {
/** The status code, which should be an enum value of google.rpc.Code. */
code?: number;
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
details?: Array<{[P in string]: any}>;
/** A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. */
message?: string;
}
interface SynthesisInput {
/** The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml). */
ssml?: string;
/** The raw text to be synthesized. */
text?: string;
}
interface SynthesizeLongAudioMetadata {
/** The progress of the most recent processing update in percentage, ie. 70.0%. */
progressPercentage?: number;
/** Time when the request was received. */
startTime?: string;
}
interface SynthesizeLongAudioRequest {
/** Required. The configuration of the synthesized audio. */
audioConfig?: AudioConfig;
/** Required. The Synthesizer requires either plain text or SSML as input. While Long Audio is in preview, SSML is temporarily unsupported. */
input?: SynthesisInput;
/** Required. Specifies a Cloud Storage URI for the synthesis results. Must be specified in the format: `gs://bucket_name/object_name`, and the bucket must already exist. */
outputGcsUri?: string;
/** Required. The desired voice of the synthesized audio. */
voice?: VoiceSelectionParams;
}
interface SynthesizeSpeechRequest {
/** Required. The configuration of the synthesized audio. */
audioConfig?: AudioConfig;
/** Whether and what timepoints are returned in the response. */
enableTimePointing?: string[];
/** Required. The Synthesizer requires either plain text or SSML as input. */
input?: SynthesisInput;
/** Required. The desired voice of the synthesized audio. */
voice?: VoiceSelectionParams;
}
interface SynthesizeSpeechResponse {
/** The audio metadata of `audio_content`. */
audioConfig?: AudioConfig;
/** The audio data bytes encoded as specified in the request, including the header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). For LINEAR16 audio, we include the WAV header. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64. */
audioContent?: string;
/** A link between a position in the original request input and a corresponding time in the output audio. It's only supported via `` of SSML input. */
timepoints?: Timepoint[];
}
interface Timepoint {
/** Timepoint name as received from the client within `` tag. */
markName?: string;
/** Time offset in seconds from the start of the synthesized audio. */
timeSeconds?: number;
}
interface Voice {
/** The languages that this voice supports, expressed as [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. "en-US", "es-419", "cmn-tw"). */
languageCodes?: string[];
/** The name of this voice. Each distinct voice has a unique name. */
name?: string;
/** The natural sample rate (in hertz) for this voice. */
naturalSampleRateHertz?: number;
/** The gender of this voice. */
ssmlGender?: string;
}
interface VoiceSelectionParams {
/** The configuration for a custom voice. If [CustomVoiceParams.model] is set, the service will choose the custom voice matching the specified configuration. */
customVoice?: CustomVoiceParams;
/** Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)". */
languageCode?: string;
/** The name of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and gender. */
name?: string;
/** The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement; if a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request. */
ssmlGender?: string;
}
interface OperationsResource {
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
get(request?: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** The name of the operation resource. */
name: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
}): Request<Operation>;
/** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
list(request?: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** The standard list filter. */
filter?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** The name of the operation's parent resource. */
name: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** The standard list page size. */
pageSize?: number;
/** The standard list page token. */
pageToken?: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
}): Request<ListOperationsResponse>;
}
interface LocationsResource {
/** Synthesizes long form text asynchronously. */
synthesizeLongAudio(request: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** The resource states of the request in the form of `projects/*‍/locations/*`. */
parent: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
/** Request body */
resource: SynthesizeLongAudioRequest;
}): Request<Operation>;
synthesizeLongAudio(
request: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** The resource states of the request in the form of `projects/*‍/locations/*`. */
parent: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
},
body: SynthesizeLongAudioRequest
): Request<Operation>;
operations: OperationsResource;
}
interface ProjectsResource {
locations: LocationsResource;
}
interface TextResource {
/** Synthesizes speech synchronously: receive results after all text input has been processed. */
synthesize(request: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
/** Request body */
resource: SynthesizeSpeechRequest;
}): Request<SynthesizeSpeechResponse>;
synthesize(
request: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
},
body: SynthesizeSpeechRequest
): Request<SynthesizeSpeechResponse>;
}
interface VoicesResource {
/** Returns a list of Voice supported for synthesis. */
list(request?: {
/** V1 error format. */
'$.xgafv'?: string;
/** OAuth access token. */
access_token?: string;
/** Data format for response. */
alt?: string;
/** JSONP */
callback?: string;
/** Selector specifying which fields to include in a partial response. */
fields?: string;
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
key?: string;
/** Optional. Recommended. [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not specified, the API will return all supported voices. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices will be returned. If you specify `"no"`, both `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be returned. */
languageCode?: string;
/** OAuth 2.0 token for the current user. */
oauth_token?: string;
/** Returns response with indentations and line breaks. */
prettyPrint?: boolean;
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
quotaUser?: string;
/** Upload protocol for media (e.g. "raw", "multipart"). */
upload_protocol?: string;
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
uploadType?: string;
}): Request<ListVoicesResponse>;
}
const projects: ProjectsResource;
const projects: ProjectsResource;
const text: TextResource;
const text: TextResource;
const voices: VoicesResource;
}
const voices: VoicesResource;
}
}
{
"name": "@maxim_mazurok/gapi.client.texttospeech-v1beta1",
"version": "0.0.20231113",
"version": "0.0.20231130",
"description": "TypeScript typings for Cloud Text-to-Speech API v1beta1",
"repository": {
"type": "git",
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
},
"license": "MIT",
"author": {
"name": "Maxim Mazurok",
"email": "maxim@mazurok.com",
"name": "Maxim Mazurok",
"url": "https://maxim.mazurok.com"
},
"repository": {
"type": "git",
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
},
"types": "index.d.ts",

@@ -16,0 +16,0 @@ "dependencies": {

@@ -28,6 +28,9 @@ # TypeScript typings for Cloud Text-to-Speech API v1beta1

```typescript
gapi.client.load('https://texttospeech.googleapis.com/$discovery/rest?version=v1beta1', () => {
// now we can use:
// gapi.client.texttospeech
});
gapi.client.load(
'https://texttospeech.googleapis.com/$discovery/rest?version=v1beta1',
() => {
// now we can use:
// gapi.client.texttospeech
}
);
```

@@ -49,17 +52,18 @@

scope = [
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
'https://www.googleapis.com/auth/cloud-platform',
],
immediate = true;
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
'https://www.googleapis.com/auth/cloud-platform',
],
immediate = true;
// ...
gapi.auth.authorize(
{ client_id: client_id, scope: scope, immediate: immediate },
{client_id: client_id, scope: scope, immediate: immediate},
authResult => {
if (authResult && !authResult.error) {
/* handle successful authorization */
/* handle successful authorization */
} else {
/* handle authorization error */
/* handle authorization error */
}
});
}
);
```

@@ -70,7 +74,6 @@

```typescript
/*
Synthesizes speech synchronously: receive results after all text input has been processed.
*/
await gapi.client.texttospeech.text.synthesize({ });
await gapi.client.texttospeech.text.synthesize({});

@@ -80,3 +83,3 @@ /*

*/
await gapi.client.texttospeech.voices.list({ });
await gapi.client.texttospeech.voices.list({});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc