Class TextToSpeechManager
- Namespace
- Uralstech.UCloud.TextToSpeech
The class for accessing the Google Cloud Text-To-Speech API!
public class TextToSpeechManager : Singleton<TextToSpeechManager>
- Inheritance
-
objectTextToSpeechManager
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
ITextToSpeechGetRequestThe 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
ITextToSpeechPostRequestThe 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
stringThe new API key.