Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 2.19 KB

API.md

File metadata and controls

62 lines (42 loc) · 2.19 KB

PollySSMLSplit

Creates a tree data structure from SSML text.

Kind: global class

new PollySSMLSplit(softLimit, hardLimit)

Set default character limits. Initialize tree.

Param Type
softLimit number
hardLimit number

pollySSMLSplit.configure(options)

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 Argument options 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.

pollySSMLSplit.split(ssml) ⇒ Array.<string>

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, increase hardLimit.
  • SSMLParseError Argument ssml is not a valid SSML string.
Param Type Description
ssml string String containing text with SSML tags.