@goodandready/dsh-tts 0.4.1 → 0.4.5

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.
package/lib/text.js CHANGED
@@ -30,7 +30,7 @@ export function applyNarrationFilters(text, cfg) {
30
30
  if (cfg && cfg.removeRegex) {
31
31
  try {
32
32
  out = out.replace(new RegExp(cfg.removeRegex, 'g'), ' ')
33
- } catch (badUserRegex) { /* кривая регулярка не роняет озвучку */ }
33
+ } catch (badUserRegex) { /* bad user regex must not break speech */ }
34
34
  }
35
35
  if (cfg && cfg.skipActions) out = out.replace(/(^|\s)\*[^*\n]+\*/g, '$1')
36
36
  if (cfg && cfg.narrateQuotesOnly) {
@@ -100,7 +100,7 @@ export function applyPronunciation(text, rules, language, enableBuiltinIt = fals
100
100
  else if (rule.whole) re = new RegExp('(?<![\\p{L}\\p{N}])' + escapeRe(rule.from) + '(?![\\p{L}\\p{N}])', 'gu')
101
101
  else re = new RegExp(escapeRe(rule.from), 'g')
102
102
  out = out.replace(re, to)
103
- } catch (badRule) { /* кривое правило не роняет озвучку */ }
103
+ } catch (badRule) { /* bad rule must not break speech */ }
104
104
  }
105
105
  return out
106
106
  }
@@ -174,14 +174,14 @@ export function restoreAbbreviations(text) {
174
174
  }
175
175
 
176
176
  /**
177
- * Режет текст на куски по границам предложений.
177
+ * Split text into chunks on sentence boundaries.
178
178
  *
179
- * Нужно, чтобы чтение начиналось почти сразу: длинный ответ синтезируется
180
- * целиком долго, а первое предложение — быстро. Куски короче нижнего порога
181
- * прилипают к следующему: отдельная фраза «Да.» звучит рвано.
179
+ * Enables low latency playback: synthesizing a whole long reply takes seconds,
180
+ * whereas the first sentence is ready almost immediately. Chunks shorter than
181
+ * the min threshold attach to the next one so speech sounds fluid.
182
182
  *
183
- * @param text {string} уже очищенный текст
184
- * @param maxChars {number} верхняя граница куска
183
+ * @param text {string} pre-cleaned text
184
+ * @param maxChars {number} upper bound for one chunk
185
185
  * @returns {string[]}
186
186
  */
187
187
  export function splitSentences(text, maxChars) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-tts",
3
- "version": "0.4.1",
3
+ "version": "0.4.5",
4
4
  "description": "Text-to-speech for DeepSeek Harness: speak agent replies in the Web UI with a provider fallback chain (OpenAI, ElevenLabs, Google, Azure, Groq, Deepgram, OpenRouter, Edge, Piper, eSpeak).",
5
5
  "license": "MIT",
6
6
  "type": "module",