AT&T API Platform SDK for Microsoft®  2.3.3
Wrapper classes that allow developers to build robust applications using .NET
 All Classes Namespaces Functions Enumerations Properties
Text To Speech Service Cookbook

Overview

This cookbook shows you how to develop a Text To Speech Service application using the Platform SDK for Microsoft.
The Platform SDK for Microsoft provides the following method:

  • Text To Speech

To use these methods in an application, perform the following steps:

  1. Add a reference to the SDK as shown in the About the Cookbooks section and import the ATT_MSSDK.TextToSpeechv1 namespace.
  2. Create an instance of RequestFactory with the scope type RequestFactory.ScopeTypes.TTS, as shown in the About the Cookbooks section.
  3. Invoke the Text To Speech Service method using the RequestFactory instance.

Converting Text to Speech

To convert text to speech, invoke the TextToSpeech method using the RequestFactory instance by passing text to be converted along with optional content type, content language, return audio format and X-Args, as shown in the following code example.

 // Text to be converted to speech audio. 
 // Must be of type specified in the Content-Type header.
 string textToConvert = "xxxxxxxxxxxx";
 
 // Must be defined as one of the following values:
 //    text/plain
 //    application/ssml+xml
 string contentType = "text/plain";
 
 // US English
 string contentLanguage = "en-US";
 TextToSpeechResponse response = this.requestFactory.TextToSpeech(textToConvert, contentType, contentType);