Spaces:
Configuration error
Configuration error
Fix first TTS word boundary
Browse files
app.js
CHANGED
|
@@ -2123,10 +2123,10 @@ function findBoundary(text, final) {
|
|
| 2123 |
const minSpace = firstChunk ? chunking.firstMinSpaceChars : chunking.minSpaceChars;
|
| 2124 |
if (text.length >= targetLength) {
|
| 2125 |
const space = text.lastIndexOf(" ", targetLength);
|
| 2126 |
-
if (space > minSpace) return boundaryAt(text, space, "space-before-target");
|
| 2127 |
const maxForward = targetLength * 2;
|
| 2128 |
const nextSpace = text.indexOf(" ", targetLength);
|
| 2129 |
-
if (nextSpace > minSpace && nextSpace <= maxForward) return boundaryAt(text, nextSpace, "space-after-target");
|
| 2130 |
if (firstChunk && text.length < maxForward) return null;
|
| 2131 |
return boundaryAt(text, targetLength, "hard-limit");
|
| 2132 |
}
|
|
|
|
| 2123 |
const minSpace = firstChunk ? chunking.firstMinSpaceChars : chunking.minSpaceChars;
|
| 2124 |
if (text.length >= targetLength) {
|
| 2125 |
const space = text.lastIndexOf(" ", targetLength);
|
| 2126 |
+
if (space >= minSpace) return boundaryAt(text, space, "space-before-target");
|
| 2127 |
const maxForward = targetLength * 2;
|
| 2128 |
const nextSpace = text.indexOf(" ", targetLength);
|
| 2129 |
+
if (nextSpace >= minSpace && nextSpace <= maxForward) return boundaryAt(text, nextSpace, "space-after-target");
|
| 2130 |
if (firstChunk && text.length < maxForward) return null;
|
| 2131 |
return boundaryAt(text, targetLength, "hard-limit");
|
| 2132 |
}
|