@met4citizen/headtts 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,8 +133,8 @@ class HeadTTS {
133
133
 
134
134
  if (letter === " ") lastSpace = i;
135
135
 
136
- const isMax = i >= this.settings.splitLength - initialLen;
137
136
  part += letter;
137
+ const isMax = (part.length + initialLen) >= this.settings.splitLength;
138
138
 
139
139
  if (isMax) {
140
140
  if (lastSpace === 0) lastSpace = i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@met4citizen/headtts",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "HeadTTS: A free Javascript text-to-speech with timestamps and visemes.",
5
5
  "main": "modules/headtts.mjs",
6
6
  "type": "module",