Auto Narrate

This section describes features that are coming in 4.0

QName: f:auto-narrate

With this feature in place, a content instance will automatically have the text from either an attachment or a property narrated using text-to-speech. The generated audio file will be stored back onto the node as an audio attachment (typically in MP3 format).

To use this service, you will first need to set up a Narration Service. The service can either be configured as the default Narration Service for your Project or it can be referenced from the f:auto-narrate feature. This allows different feature configurations to use different services if that is your preference.

The feature is defined as shown here:

{
    "_qname": "f:auto-narrate",
    "_type": "d:feature",
    "type": "object",
    "title": "Auto Narrate",
    "description": "Indicates that a node with an attachment should have a narration produced automatically",
    "systemBootstrapped": true
}

Configuration

<thead>
    <tr>
        <th>Property</th>
        <th>Type</th>
        <th>Default</th>
        <th nowrap>Read-Only</th>
        <th>Description</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>serviceId</td>
        <td>text</td>
        <td></td>
        <td></td>
        <td>
            The `_doc` identifier of the Narration Service configuration to use.
        </td>
    </tr>
    <tr>
        <td>sourceAttachmentId</td>
        <td>text</td>
        <td></td>
        <td></td>
        <td>
            The name of the source attachment containing the source text.  Default is `default`.
        </td>
    </tr>
    <tr>
        <td>sourcePropertyId</td>
        <td>text</td>
        <td></td>
        <td></td>
        <td>
            The ID or path to the property on the node that contains the source text.
        </td>
    </tr>
    <tr>
        <td>config</td>
        <td>object</td>
        <td></td>
        <td></td>
        <td>
            A configuration object that gets passed to your Narration Service to allow for customization of how
            the narration is generated.
        </td>
    </tr>
</tbody>

Narration

The resulting narration audio file is stored onto the content node as the narration attachment.

For more information, please see our formal documentation on how Cloud CMS works with Narration.

Example

If you have a default Narration Service configured for your project, all you need to do is this:

{
    "title": "My Document",
    "_features": {
        "f:auto-narrate": {
        }
    }
}

Otherwise, you will need to point to a configuration:

{
    "title": "My Document",
    "_features": {
        "f:auto-narrate": {
            "serviceId": "ec0a7bfb2d2f971b262e"
        }
    }
}

We can use the mandatoryFeatures block on a content type to make it so that all instances of that type of content will have narration occur for a given source property. Here is an example:

{
    "title": "Snippet",
    "type": "object",
    "properties": {
        "title": {
            "type": "string",
            "title": "Title"
        },
        "text": {
            "type": "string"
        }
    },
    "mandatoryFeatures": {
        "f:auto-narrate": {
            "sourcePropertyId": "text"
        }
    }
}

Additional Options for AWS Polly

If you're using AWS Polly for your Narration Service, you can use the config block to specify a few additional options:

  • languageCode - an AWS language code to identify the intended output language. For example, you could set es-ES for Spanish or cmn-CN for Chinese.
  • voiceId - the voice to use while narrating

Note that the selected voice must be compatible with the given language code. For an exact list of what voices are available for a given language, please refer to the Official AWS Polly Documentation.

Suppose we have the following text in German:

Jeder Wer unten in Whoville mochte Weihnachten sehr Aber der Grinch, der gerade nördlich von Whoville lebte, tat es nicht! Der Grinch hasste Weihnachten! Die ganze Weihnachtszeit! Fragen Sie bitte nicht, warum. Niemand kennt den Grund. Es könnte sein, dass seine Schuhe zu eng waren. Es könnte sein, dass sein Kopf nicht richtig angeschraubt wurde. Aber ich denke, dass der wahrscheinlichste Grund aller Vielleicht war sein Herz zwei Größen zu klein.

We can configure the feature to generate the Narration audio in German like this:

{
    "title": "Snippet",
    "type": "object",
    "properties": {
        "title": {
            "type": "string",
            "title": "Title"
        },
        "text": {
            "type": "string"
        }
    },
    "mandatoryFeatures": {
        "f:auto-narrate": {
            "sourcePropertyId": "text",
            "config": {
                "languageCode": "de-DE",
                "voiceId": "Vicki"
            }
        }
    }
}

This will result in the Narration audio being read in German using the "Vicki" voice.

Here an example of the output:

.