GoogleCloudTTSOptions

Options & Configuration · AiDotNet.TextToSpeech.ProprietaryAPI

Options for the Google Cloud Text-to-Speech client (POST /v1/text:synthesize).

Inheritance: CloudTtsOptions → GoogleCloudTTSOptions

For Beginners

Set ApiKey to an API key restricted to the Text-to-Speech API, or AccessToken to an OAuth token.

How It Works

Defaults: the endpoint https://texttospeech.googleapis.com, the voice en-US-Neural2-F (its language code is the name’s first two parts), and LINEAR16 at 24 kHz, which the service returns as a WAV file (base64 in the JSON audioContent). Authentication is an API key (X-Goog-Api-Key) or an OAuth access token (bearer). The service accepts at most 5,000 bytes of input.

Constructors

Constructor Summary
GoogleCloudTTSOptions() Creates the default options.
GoogleCloudTTSOptions(GoogleCloudTTSOptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
bool TextIsSsml { get; set; } Gets or sets whether the text is SSML rather than plain text.
double? Pitch { get; set; } Gets or sets the pitch in semitones (−20–20), or null for 0.
double? SpeakingRate { get; set; } Gets or sets the speaking rate (0.25–4), or null for 1.
string AccessToken { get; set; } Gets or sets an OAuth access token used instead of the API key, or null.
string LanguageCode { get; set; } Gets or sets the language code, or null to take it from the voice name.