AWS Polly

QName: f:aws-polly

Allows for a node to automatically generate a lifelike speech reading of its default attachment. When completed, this reading will be saved back to the document as another attachment polly.mp3. This feature can be configured to work with a number of language and voice combinations.

To learn more about Amazon Polly, see: https://docs.aws.amazon.com/polly/latest/dg/what-is.html

For a list of all allowed languages and voices, see: https://docs.aws.amazon.com/polly/latest/dg/voicelist.html

To use this feature, you will need an AWS account with an S3 bucket, along with IAM user credential that provide full access rights to the Amazon Polly service.

Configuration

Property Type Required Default Read-Only Description
serviceDescriptorId text false The ID or Key of the service descriptor to use.
languageCode text true Represents the language of the input document to be read. This is optional if your document has the f:locale feature associated with it.
voiceId text false The ID of the voice to read the document aloud. The voice provided must be allowed for the specified language.

Create a Service Descriptor

To use this feature, you will first need to declare a Service within Cloud CMS. Go to the Manage Platform > Services page and then click Create a New Service.

Given the service any Title and unique Key that you'd like.

The type should be aws_polly and the configuration should look like this:

{
    "accessKey": "",
    "secretKey": "",
    "region": "",
    "bucketName": ""
}

Save your service. That's all there is to it.

Apply the Feature to your Definition

As with all features, you can apply them at either the instance or the type level.

Suppose you have a content type called Article which stores text that appears on a web site. It might look like this:

{
    "title": "Article",
    "_qname": "my:article",
    "properties": {
        "title": {
            "title": "Title",
            "type": "string"
        },
        "Description": {
            "title": "Description",
            "type": "string"
        }        
    }
}

Each article would have an associated pdf file representing the text of the article. We will add the f:aws-polly feature like this:

{
    "title": "Article",
    "_qname": "my:article",
    "properties": {
        "title": {
            "title": "Title",
            "type": "string"
        },
        "Description": {
            "title": "Description",
            "type": "string"
        }        
    },
    "mandatoryFeatures": {
        "f:aws-polly": {
            "languageCode": "en",
            "voiceId": "kendra"
        }
    }
}

All instances of Article created will eventually receive a generated attachment with id polly and filename polly.mp3, which will be a reading with Kendra's voice of the attached document.