@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/breaker.js +64 -0
- package/lib/cache.js +1 -1
- package/lib/client-src/10-styles.js +8 -8
- package/lib/client-src/20-player.js +59 -21
- package/lib/client-src/30-locales.js +36 -0
- package/lib/client-src/40-editors.js +31 -51
- package/lib/client-src/50-settings.js +93 -36
- package/lib/client-src/60-card-dock.js +50 -44
- package/lib/client.js +277 -160
- package/lib/index.js +27 -4
- package/lib/local.js +5 -7
- package/lib/providers/cloud.js +278 -0
- package/lib/providers/constants.js +61 -0
- package/lib/providers/local.js +99 -0
- package/lib/providers.js +11 -435
- package/lib/routes.js +17 -10
- package/lib/stream-hub.js +61 -9
- package/lib/text.js +8 -8
- package/package.json +1 -1
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.
|
|
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",
|