Table of Contents

Class TextToSpeechManager

The class for accessing the Google Cloud Text-To-Speech API!

public class TextToSpeechManager : Singleton<TextToSpeechManager>
Inheritance
object
TextToSpeechManager

Fields

BaseServiceUri

The base URI to the Text To Speech service.

public const string BaseServiceUri = "https://texttospeech.googleapis.com"

Field Value

string

BetaApiUri

The beta API URI to the Text To Speech service.

public const string BetaApiUri = "https://texttospeech.googleapis.com/v1beta1"

Field Value

string

ProductionApiUri

The production v1 API URI to the Text To Speech service.

public const string ProductionApiUri = "https://texttospeech.googleapis.com/v1"

Field Value

string

Methods

Request<TResponse>(ITextToSpeechGetRequest)

Computes a GET request on the TTS API.

public Awaitable<TResponse> Request<TResponse>(ITextToSpeechGetRequest request)

Parameters

request ITextToSpeechGetRequest

The request object.

Returns

Awaitable<TResponse>

The computed response.

Type Parameters

TResponse

The response type. For example, a request of type TextToSpeechSynthesisRequest corresponds to a response type of TextToSpeechSynthesisResponse.

Exceptions

TextToSpeechRequestException

Thrown if the API request fails.

TextToSpeechResponseParsingException

Thrown if the response could not be parsed.

Request<TResponse>(ITextToSpeechPostRequest)

Computes a POST request on the TTS API.

public Awaitable<TResponse> Request<TResponse>(ITextToSpeechPostRequest request)

Parameters

request ITextToSpeechPostRequest

The request object.

Returns

Awaitable<TResponse>

The computed response.

Type Parameters

TResponse

The response type. For example, a request of type TextToSpeechSynthesisRequest corresponds to a response type of TextToSpeechSynthesisResponse.

Exceptions

TextToSpeechRequestException

Thrown if the API request fails.

TextToSpeechResponseParsingException

Thrown if the response could not be parsed.

SetApiKey(string)

Sets the Text To Speech API key.

public void SetApiKey(string apiKey)

Parameters

apiKey string

The new API key.