add space to the end of sentence

This commit is contained in:
Hongbo Wu 2022-10-05 17:55:10 +08:00
parent 73de22f678
commit 811cec6c93

View file

@ -313,6 +313,10 @@ const textToUtterances = ({
// use nlp lib to detect sentences and
// avoid splitting words and sentences
sentences.forEach((sentence, i) => {
if (i < sentences.length - 1) {
// add space to the end of sentence
sentence += ' '
}
const nextText = currentText + sentence
if (nextText.length > MAX_CHARS) {
if (currentText.length > 0) {