Creates a tree data structure from SSML text.
Kind: global class
- PollySSMLSplit
- new PollySSMLSplit(softLimit, hardLimit)
- .configure(options)
- .split(ssml) ⇒
Array.<string>
Set default character limits. Initialize tree.
Param | Type |
---|---|
softLimit | number |
hardLimit | number |
Set configuration options.
This is optional. Default options are perfect for working with AWS Polly TTS.
Notice that softLimit
and hardLimit
count only text characters, not SSML tags.
AWS Polly ignores SSML tags length, only text characters matter.
Kind: instance method of PollySSMLSplit
Throws:
ConfigurationValidationError
Argumentoptions
is not valid.
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Object with configuration options. | |
options.softLimit | number |
1000 |
Limit of a min batch size. |
options.hardLimit | number |
1500 |
Limit of a max possible batch size. |
[options.extraSplitChars] | string |
",;" |
String with characters, that can be used as split markers for plain text. Optional parameter. |
Split SSML text by batches of ~1500 (by default) chars.
Kind: instance method of PollySSMLSplit
Returns: Array.<string>
- Array of valid SSML strings.
Throws:
NotPossibleSplitError
Text cannot be split, increasehardLimit
.SSMLParseError
Argumentssml
is not a valid SSML string.
Param | Type | Description |
---|---|---|
ssml | string |
String containing text with SSML tags. |