@suitecut/audio-kokoro-sherpa 1.0.0

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/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Sherpa Kokoro audio plugin
2
+
3
+ Install this adapter for Sherpa-compatible Kokoro model files. SuiteCut's bundled `kokoro`
4
+ provider does not need this package.
5
+
6
+ ```sh
7
+ npm install --save-dev @suitecut/audio-kokoro-sherpa
8
+ ```
9
+
10
+ Configure a provider ID other than the reserved built-in `kokoro` ID.
11
+
12
+ ```ts
13
+ {
14
+ provider: 'kokoro-sherpa',
15
+ module: '@suitecut/audio-kokoro-sherpa',
16
+ options: {
17
+ model: './models/kokoro/model.onnx',
18
+ voices: './models/kokoro/voices.bin',
19
+ tokens: './models/kokoro/tokens.txt',
20
+ dataDir: './models/kokoro/espeak-ng-data',
21
+ },
22
+ }
23
+ ```
@@ -0,0 +1,3 @@
1
+ declare const _default: import("../../../dist/audio-plugin.js").SuiteCutAudioPlugin;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAmBA,wBAcE"}
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ import { createSherpaAudioPlugin, sherpaCommonOptionsShape, sherpaFilePathSchema, sherpaPositiveScaleSchema, } from '@suitecut/audio-sherpa-core';
2
+ import { z } from 'zod';
3
+ const OptionsSchema = z.strictObject({
4
+ ...sherpaCommonOptionsShape,
5
+ model: sherpaFilePathSchema,
6
+ voices: sherpaFilePathSchema,
7
+ tokens: sherpaFilePathSchema,
8
+ dataDir: sherpaFilePathSchema.exactOptional(),
9
+ lexicon: sherpaFilePathSchema.exactOptional(),
10
+ language: z.string().trim().min(1).exactOptional(),
11
+ lengthScale: sherpaPositiveScaleSchema.exactOptional(),
12
+ });
13
+ export default createSherpaAudioPlugin({
14
+ family: 'kokoro',
15
+ schema: OptionsSchema,
16
+ model: (options) => ({
17
+ kokoro: {
18
+ model: options.model,
19
+ voices: options.voices,
20
+ tokens: options.tokens,
21
+ ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),
22
+ ...(options.lexicon === undefined ? {} : { lexicon: options.lexicon }),
23
+ ...(options.language === undefined ? {} : { lang: options.language }),
24
+ ...(options.lengthScale === undefined ? {} : { lengthScale: options.lengthScale }),
25
+ },
26
+ }),
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,aAAa,GAAG,CAAC,CAAC,YAAY,CAAC;IACnC,GAAG,wBAAwB;IAC3B,KAAK,EAAE,oBAAoB;IAC3B,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,oBAAoB;IAC5B,OAAO,EAAE,oBAAoB,CAAC,aAAa,EAAE;IAC7C,OAAO,EAAE,oBAAoB,CAAC,aAAa,EAAE;IAC7C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE;IAClD,WAAW,EAAE,yBAAyB,CAAC,aAAa,EAAE;CACvD,CAAC,CAAA;AAEF,eAAe,uBAAuB,CAAC;IACrC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACnB,MAAM,EAAE;YACN,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;YACtE,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;YACtE,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrE,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;SACnF;KACF,CAAC;CACH,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@suitecut/audio-kokoro-sherpa",
3
+ "version": "1.0.0",
4
+ "description": "Sherpa-compatible Kokoro WebAssembly text-to-speech plugin for SuiteCut.",
5
+ "keywords": [
6
+ "suitecut",
7
+ "kokoro",
8
+ "sherpa-onnx",
9
+ "webassembly",
10
+ "text-to-speech"
11
+ ],
12
+ "homepage": "https://github.com/skyaara/suitecut/tree/main/plugins/kokoro-sherpa",
13
+ "bugs": {
14
+ "url": "https://github.com/skyaara/suitecut/issues"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/skyaara/suitecut.git",
19
+ "directory": "plugins/kokoro-sherpa"
20
+ },
21
+ "type": "module",
22
+ "license": "MIT",
23
+ "sideEffects": false,
24
+ "main": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.js"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md"
35
+ ],
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "scripts": {
40
+ "build": "pnpm clean:dist && tsc -p tsconfig.json",
41
+ "check": "tsc --noEmit -p tsconfig.json",
42
+ "clean:dist": "node ../../scripts/clean-plugin-dist.mjs",
43
+ "prepack": "pnpm build"
44
+ },
45
+ "peerDependencies": {
46
+ "suitecut": ">=1.0.0 <2"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "suitecut": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "dependencies": {
54
+ "@suitecut/audio-sherpa-core": "^1.0.0",
55
+ "zod": "^4.4.3"
56
+ },
57
+ "engines": {
58
+ "node": ">=22.0.0"
59
+ }
60
+ }