klaudio 0.9.0 → 0.9.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.
- package/package.json +1 -1
- package/src/player.js +6 -3
- package/src/tts.js +1 -0
package/package.json
CHANGED
package/src/player.js
CHANGED
|
@@ -403,8 +403,9 @@ export async function handlePlayCommand(args) {
|
|
|
403
403
|
.replace(/_([^_]+)_/g, "$1") // _italic_ -> text
|
|
404
404
|
.replace(/#{1,6}\s+/g, "") // headings
|
|
405
405
|
.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1") // [links](url) -> text
|
|
406
|
-
.replace(
|
|
407
|
-
.replace(/^\s
|
|
406
|
+
.replace(/\([^)]*\)/g, "") // remove parenthesised content
|
|
407
|
+
.replace(/^\s*[-*+]\s+(.*)/gm, "... $1.") // list bullets -> paused items
|
|
408
|
+
.replace(/^\s*\d+\.\s+(.*)/gm, "... $1.") // numbered lists -> paused items
|
|
408
409
|
.replace(/\n+/g, " ") // newlines -> spaces
|
|
409
410
|
.trim();
|
|
410
411
|
// Build summary: include sentences up to ~25 words max.
|
|
@@ -430,12 +431,14 @@ export async function handlePlayCommand(args) {
|
|
|
430
431
|
}
|
|
431
432
|
// Include next sentence if we're still under the word limit
|
|
432
433
|
if (wordsSoFar + nextWords <= MAX_WORDS) {
|
|
433
|
-
summary += " " + next;
|
|
434
|
+
summary += " ... " + next;
|
|
434
435
|
} else {
|
|
435
436
|
break;
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
439
|
}
|
|
440
|
+
// Collapse repeated ellipsis/dots and ensure pauses between sentences
|
|
441
|
+
summary = summary.replace(/\.{2,}/g, "...").replace(/\s{2,}/g, " ");
|
|
439
442
|
// Prefix with project folder name if available
|
|
440
443
|
const project = hookData.cwd ? hookData.cwd.replace(/\\/g, "/").split("/").pop() : null;
|
|
441
444
|
const spoken = project ? `${project}: ${summary}` : summary;
|
package/src/tts.js
CHANGED
|
@@ -220,6 +220,7 @@ export async function speak(text, onProgress) {
|
|
|
220
220
|
const child = execFile(piperBin, [
|
|
221
221
|
"--model", modelPath,
|
|
222
222
|
"--output_file", outPath,
|
|
223
|
+
"--sentence_silence", "0.5",
|
|
223
224
|
], { windowsHide: true, timeout: 15000 }, (err) => {
|
|
224
225
|
if (err) reject(err);
|
|
225
226
|
else resolve();
|