AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing Polly Amazon Polly is a web service that makes it easy to synthesize speech from text.

The Amazon Polly service provides API operations for synthesizing high-quality speech from plain text and Speech Synthesis Markup Language (SSML), along with managing pronunciations lexicons that enable you to get the best results for your application domain.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.Polly.AmazonPollyClient

Namespace: Amazon.Polly
Assembly: AWSSDK.Polly.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonPollyClient : AmazonServiceClient
         IAmazonPolly, IAmazonService, IDisposable

The AmazonPollyClient type exposes the following members

Constructors

NameDescription
Public Method AmazonPollyClient()

Constructs AmazonPollyClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonPollyClient(RegionEndpoint)

Constructs AmazonPollyClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonPollyClient(AmazonPollyConfig)

Constructs AmazonPollyClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.



    
        
    

             

Public Method AmazonPollyClient(AWSCredentials)

Constructs AmazonPollyClient with AWS Credentials

Public Method AmazonPollyClient(AWSCredentials, RegionEndpoint)

Constructs AmazonPollyClient with AWS Credentials

Public Method AmazonPollyClient(AWSCredentials, AmazonPollyConfig)

Constructs AmazonPollyClient with AWS Credentials and an AmazonPollyClient Configuration object.

Public Method AmazonPollyClient(string, string)

Constructs AmazonPollyClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPollyClient(string, string, RegionEndpoint)

Constructs AmazonPollyClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPollyClient(string, string, AmazonPollyConfig)

Constructs AmazonPollyClient with AWS Access Key ID, AWS Secret Key and an AmazonPollyClient Configuration object.

Public Method AmazonPollyClient(string, string, string)

Constructs AmazonPollyClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPollyClient(string, string, string, RegionEndpoint)

Constructs AmazonPollyClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonPollyClient(string, string, string, AmazonPollyConfig)

Constructs AmazonPollyClient with AWS Access Key ID, AWS Secret Key and an AmazonPollyClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method DeleteLexicon(DeleteLexiconRequest)

Deletes the specified pronunciation lexicon stored in an AWS Region. A lexicon which has been deleted is not available for speech synthesis, nor is it possible to retrieve it using either the GetLexicon or ListLexicon APIs.

For more information, see Managing Lexicons.

Public Method DeleteLexiconAsync(DeleteLexiconRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteLexicon operation.

Public Method DescribeVoices(DescribeVoicesRequest)

Returns the list of voices that are available for use when requesting speech synthesis. Each voice speaks a specified language, is either male or female, and is identified by an ID, which is the ASCII version of the voice name.

When synthesizing speech ( SynthesizeSpeech ), you provide the voice ID for the voice you want from the list of voices returned by DescribeVoices.

For example, you want your news reader application to read news in a specific language, but giving a user the option to choose the voice. Using the DescribeVoices operation you can provide the user with a list of available voices to select from.

You can optionally specify a language code to filter the available voices. For example, if you specify en-US, the operation returns a list of all available US English voices.

This operation requires permissions to perform the polly:DescribeVoices action.

Public Method DescribeVoicesAsync(DescribeVoicesRequest, CancellationToken)

Initiates the asynchronous execution of the DescribeVoices operation.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetLexicon(GetLexiconRequest)

Returns the content of the specified pronunciation lexicon stored in an AWS Region. For more information, see Managing Lexicons.

Public Method GetLexiconAsync(GetLexiconRequest, CancellationToken)

Initiates the asynchronous execution of the GetLexicon operation.

Public Method ListLexicons(ListLexiconsRequest)

Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see Managing Lexicons.

Public Method ListLexiconsAsync(ListLexiconsRequest, CancellationToken)

Initiates the asynchronous execution of the ListLexicons operation.

Public Method PutLexicon(PutLexiconRequest)

Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.

For more information, see Managing Lexicons.

Public Method PutLexiconAsync(PutLexiconRequest, CancellationToken)

Initiates the asynchronous execution of the PutLexicon operation.

Public Method SynthesizeSpeech(SynthesizeSpeechRequest)

Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.

Public Method SynthesizeSpeechAsync(SynthesizeSpeechRequest, CancellationToken)

Initiates the asynchronous execution of the SynthesizeSpeech operation.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms