New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ssml-split

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssml-split - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

6

API.md

@@ -42,4 +42,4 @@ <a name="SSMLSplit"></a>

| options | <code>Object</code> | | Object with configuration options. |
| options.softLimit | <code>number</code> | <code>1000</code> | Limit of a min batch size. |
| options.hardLimit | <code>number</code> | <code>1500</code> | Limit of a max possible batch size. |
| options.softLimit | <code>number</code> | <code>1500</code> | Limit of a min batch size. |
| options.hardLimit | <code>number</code> | <code>3000</code> | Limit of a max possible batch size. |
| [options.extraSplitChars] | <code>string</code> | <code>&quot;,;&quot;</code> | String with characters, that can be used as split markers for plain text. Optional parameter. |

@@ -50,3 +50,3 @@

### SSMLSplit.split(ssml) ⇒ <code>Array.&lt;string&gt;</code>
Split SSML text by batches of ~1500 (by default) chars.
Split SSML text by batches of ~3000 (by default) chars.

@@ -53,0 +53,0 @@ **Kind**: instance method of [<code>SSMLSplit</code>](#SSMLSplit)

@@ -1,3 +0,3 @@

exports.SOFT_LIMIT = 1000
exports.HARD_LIMIT = 1500
exports.EXTRA_SPLIT_CHARS = ',;'
exports.SOFT_LIMIT = 1500
exports.HARD_LIMIT = 3000
exports.EXTRA_SPLIT_CHARS = ',;'

@@ -68,4 +68,4 @@ const pollyTextSplit = require('polly-text-split')

* @param {Object} options Object with configuration options.
* @param {number} options.softLimit=1000 Limit of a min batch size.
* @param {number} options.hardLimit=1500 Limit of a max possible batch size.
* @param {number} options.softLimit=1500 Limit of a min batch size.
* @param {number} options.hardLimit=3000 Limit of a max possible batch size.
* @param {string} [options.extraSplitChars=,;] String with characters, that can be used as split markers for plain text. Optional parameter.

@@ -94,3 +94,3 @@ * @throws {ConfigurationValidationError} Argument `options` is not valid.

/**
* Split SSML text by batches of ~1500 (by default) chars.
* Split SSML text by batches of ~3000 (by default) chars.
*

@@ -97,0 +97,0 @@ * @param {string} ssml String containing text with SSML tags.

{
"name": "ssml-split",
"version": "0.1.2",
"version": "0.1.3",
"description": "Splits long texts with SSML tags by batches suitable for working with AWS Polly TTS and Google Cloud Text to Speech.",

@@ -5,0 +5,0 @@ "main": "index.js",

# SSML Split
[![Build Status](https://travis-ci.org/jvandenaardweg/ssml-split.svg?branch=master)](https://travis-ci.org/jvandenaardweg/ssml-split)
[![Coverage Status](https://coveralls.io/repos/github/jvandenaardweg/ssml-split/badge.svg?branch=master)](https://coveralls.io/github/jvandenaardweg/ssml-split?branch=master)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
Splits SSML strings into batches AWS Polly ánd Google's Text to Speech API can consume.

@@ -18,3 +22,5 @@

### Usage:
`npm install ssml-split --save`
```
npm install ssml-split --save
```

@@ -25,3 +31,3 @@ ```javascript

const options = {
softLimit: 4000, // Allow the splitter to find the correct split moment between 4000-5000 characters
softLimit: 2500, // Finds a possible split moment starting from 2500 characters
hardLimit: 5000, // Google Text to Speech limitation

@@ -38,3 +44,24 @@ includeSSMLTagsInCounter: true // Set true when using Google Text to Speech API, set to false with AWS Polly

## Why?
### Options
#### AWS
```javascript
const options = {
softLimit: 1500,
hardLimit: 3000, // AWS Polly limitation
includeSSMLTagsInCounter: false
}
```
#### Google
```javascript
const options = {
softLimit: 2500,
hardLimit: 5000, // Google Text to Speech API limitation
includeSSMLTagsInCounter: true
}
```
You can tweak the `softLimit` to see what works for you. I suggest you keep the `hardLimit` at the limitation limit of the respective API.
### Why not just use `polly-ssml-split`?
AWS Polly just counts the characters between the SSML tags. Google's Text to Speech is a little bit different, it includes the SSML tag characters in the character count of the `5000` character limit.

@@ -41,0 +68,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc