klaudio 0.12.2 → 0.12.3
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/installer.js +2 -2
- package/src/tts.js +7 -7
package/package.json
CHANGED
package/src/installer.js
CHANGED
|
@@ -80,9 +80,9 @@ export async function install({ scope, sounds, tts = false, voice } = {}) {
|
|
|
80
80
|
settings.hooks[hookEvent] = [];
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// Remove any existing klaudio/klonk entries
|
|
83
|
+
// Remove any existing klaudio/klonk entries (including legacy hooks without marker)
|
|
84
84
|
settings.hooks[hookEvent] = settings.hooks[hookEvent].filter(
|
|
85
|
-
(entry) => !entry._klaudio && !entry._klonk
|
|
85
|
+
(entry) => !entry._klaudio && !entry._klonk && !entry.hooks?.[0]?.command?.includes(".claude/sounds/")
|
|
86
86
|
);
|
|
87
87
|
|
|
88
88
|
// Add our hook
|
package/src/tts.js
CHANGED
|
@@ -374,8 +374,13 @@ export async function speak(text, options = {}) {
|
|
|
374
374
|
? { voice: null, onProgress: options } // backwards compat: speak(text, onProgress)
|
|
375
375
|
: options;
|
|
376
376
|
|
|
377
|
-
//
|
|
378
|
-
//
|
|
377
|
+
// macOS: use built-in `say` (skip Kokoro — native onnxruntime module
|
|
378
|
+
// can abort the process with a C++ exception before JS can catch it)
|
|
379
|
+
if (platform() === "darwin") {
|
|
380
|
+
return speakMacOS(text);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Try Kokoro (best quality, works on Linux/Windows)
|
|
379
384
|
if (await isKokoroAvailable()) {
|
|
380
385
|
try {
|
|
381
386
|
await speakKokoro(text, voice);
|
|
@@ -385,11 +390,6 @@ export async function speak(text, options = {}) {
|
|
|
385
390
|
}
|
|
386
391
|
}
|
|
387
392
|
|
|
388
|
-
// macOS: use built-in `say`
|
|
389
|
-
if (platform() === "darwin") {
|
|
390
|
-
return speakMacOS(text);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
393
|
// Fallback: Piper
|
|
394
394
|
return speakPiper(text, onProgress);
|
|
395
395
|
} finally {
|