@jskit-ai/assistant-voice-sherpa 0.1.8 → 0.1.9

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 CHANGED
@@ -73,6 +73,8 @@ unfinished native synthesis; the next request recreates that worker if needed.
73
73
  `--pack kokoro` uses Kokoro 1.0 with named female
74
74
  Heart, Bella and Emma voices, and male Michael, Adam, George and Daniel voices.
75
75
  The service advertises these IDs/labels; the browser selects a speaker per reply.
76
+ Built-in voice labels include their model family: Piper, Kitten, Kokoro or Kokoro
77
+ q8f16. Voice IDs and speaker choices remain stable when labels change.
76
78
  Model weights are not included in the npm artifact.
77
79
 
78
80
  `--pack kokoro-q8f16` offers all 28 American/British English Kokoro voices with
@@ -99,6 +101,11 @@ Piper's Cori default, existing voice IDs and Kitten Bella's 1.15× speed. Kokoro
99
101
  files and CPU configuration live beneath `tts/kokoro-q8f16`; Piper and Kitten
100
102
  files are never overwritten. The existing single synthesis process switches
101
103
  models between replies and releases the previous model before loading another.
104
+ The last-used synthesis worker stays loaded while idle. Replies selecting that
105
+ same model reuse it, including another speaker in the same Kitten/Kokoro model.
106
+ Cancellation terminates the worker immediately; the next reply loads a new one.
107
+ This saves model startup time but does not reduce the inference required to
108
+ generate speech. Only one model remains resident.
102
109
  Output keeps the existing combined pack's 22,050 Hz rate through the same
103
110
  resampler. The standalone presets remain available.
104
111
 
@@ -69,169 +69,169 @@
69
69
  "voices": [
70
70
  {
71
71
  "id": "af_alloy",
72
- "label": "Alloy · female · American English",
72
+ "label": "Alloy · female · American English · Kokoro q8f16",
73
73
  "language": "en-US",
74
74
  "speakerId": 0
75
75
  },
76
76
  {
77
77
  "id": "af_aoede",
78
- "label": "Aoede · female · American English",
78
+ "label": "Aoede · female · American English · Kokoro q8f16",
79
79
  "language": "en-US",
80
80
  "speakerId": 1
81
81
  },
82
82
  {
83
83
  "id": "af_bella",
84
- "label": "Bella · female · American English",
84
+ "label": "Bella · female · American English · Kokoro q8f16",
85
85
  "language": "en-US",
86
86
  "speakerId": 2
87
87
  },
88
88
  {
89
89
  "id": "af_heart",
90
- "label": "Heart · female · American English",
90
+ "label": "Heart · female · American English · Kokoro q8f16",
91
91
  "language": "en-US",
92
92
  "speakerId": 3
93
93
  },
94
94
  {
95
95
  "id": "af_jessica",
96
- "label": "Jessica · female · American English",
96
+ "label": "Jessica · female · American English · Kokoro q8f16",
97
97
  "language": "en-US",
98
98
  "speakerId": 4
99
99
  },
100
100
  {
101
101
  "id": "af_kore",
102
- "label": "Kore · female · American English",
102
+ "label": "Kore · female · American English · Kokoro q8f16",
103
103
  "language": "en-US",
104
104
  "speakerId": 5
105
105
  },
106
106
  {
107
107
  "id": "af_nicole",
108
- "label": "Nicole · female · American English",
108
+ "label": "Nicole · female · American English · Kokoro q8f16",
109
109
  "language": "en-US",
110
110
  "speakerId": 6
111
111
  },
112
112
  {
113
113
  "id": "af_nova",
114
- "label": "Nova · female · American English",
114
+ "label": "Nova · female · American English · Kokoro q8f16",
115
115
  "language": "en-US",
116
116
  "speakerId": 7
117
117
  },
118
118
  {
119
119
  "id": "af_river",
120
- "label": "River · female · American English",
120
+ "label": "River · female · American English · Kokoro q8f16",
121
121
  "language": "en-US",
122
122
  "speakerId": 8
123
123
  },
124
124
  {
125
125
  "id": "af_sarah",
126
- "label": "Sarah · female · American English",
126
+ "label": "Sarah · female · American English · Kokoro q8f16",
127
127
  "language": "en-US",
128
128
  "speakerId": 9
129
129
  },
130
130
  {
131
131
  "id": "af_sky",
132
- "label": "Sky · female · American English",
132
+ "label": "Sky · female · American English · Kokoro q8f16",
133
133
  "language": "en-US",
134
134
  "speakerId": 10
135
135
  },
136
136
  {
137
137
  "id": "am_adam",
138
- "label": "Adam · male · American English",
138
+ "label": "Adam · male · American English · Kokoro q8f16",
139
139
  "language": "en-US",
140
140
  "speakerId": 11
141
141
  },
142
142
  {
143
143
  "id": "am_echo",
144
- "label": "Echo · male · American English",
144
+ "label": "Echo · male · American English · Kokoro q8f16",
145
145
  "language": "en-US",
146
146
  "speakerId": 12
147
147
  },
148
148
  {
149
149
  "id": "am_eric",
150
- "label": "Eric · male · American English",
150
+ "label": "Eric · male · American English · Kokoro q8f16",
151
151
  "language": "en-US",
152
152
  "speakerId": 13
153
153
  },
154
154
  {
155
155
  "id": "am_fenrir",
156
- "label": "Fenrir · male · American English",
156
+ "label": "Fenrir · male · American English · Kokoro q8f16",
157
157
  "language": "en-US",
158
158
  "speakerId": 14
159
159
  },
160
160
  {
161
161
  "id": "am_liam",
162
- "label": "Liam · male · American English",
162
+ "label": "Liam · male · American English · Kokoro q8f16",
163
163
  "language": "en-US",
164
164
  "speakerId": 15
165
165
  },
166
166
  {
167
167
  "id": "am_michael",
168
- "label": "Michael · male · American English",
168
+ "label": "Michael · male · American English · Kokoro q8f16",
169
169
  "language": "en-US",
170
170
  "speakerId": 16
171
171
  },
172
172
  {
173
173
  "id": "am_onyx",
174
- "label": "Onyx · male · American English",
174
+ "label": "Onyx · male · American English · Kokoro q8f16",
175
175
  "language": "en-US",
176
176
  "speakerId": 17
177
177
  },
178
178
  {
179
179
  "id": "am_puck",
180
- "label": "Puck · male · American English",
180
+ "label": "Puck · male · American English · Kokoro q8f16",
181
181
  "language": "en-US",
182
182
  "speakerId": 18
183
183
  },
184
184
  {
185
185
  "id": "am_santa",
186
- "label": "Santa · male · American English",
186
+ "label": "Santa · male · American English · Kokoro q8f16",
187
187
  "language": "en-US",
188
188
  "speakerId": 19
189
189
  },
190
190
  {
191
191
  "id": "bf_alice",
192
- "label": "Alice · female · British English",
192
+ "label": "Alice · female · British English · Kokoro q8f16",
193
193
  "language": "en-GB",
194
194
  "speakerId": 20
195
195
  },
196
196
  {
197
197
  "id": "bf_emma",
198
- "label": "Emma · female · British English",
198
+ "label": "Emma · female · British English · Kokoro q8f16",
199
199
  "language": "en-GB",
200
200
  "speakerId": 21
201
201
  },
202
202
  {
203
203
  "id": "bf_isabella",
204
- "label": "Isabella · female · British English",
204
+ "label": "Isabella · female · British English · Kokoro q8f16",
205
205
  "language": "en-GB",
206
206
  "speakerId": 22
207
207
  },
208
208
  {
209
209
  "id": "bf_lily",
210
- "label": "Lily · female · British English",
210
+ "label": "Lily · female · British English · Kokoro q8f16",
211
211
  "language": "en-GB",
212
212
  "speakerId": 23
213
213
  },
214
214
  {
215
215
  "id": "bm_daniel",
216
- "label": "Daniel · male · British English",
216
+ "label": "Daniel · male · British English · Kokoro q8f16",
217
217
  "language": "en-GB",
218
218
  "speakerId": 24
219
219
  },
220
220
  {
221
221
  "id": "bm_fable",
222
- "label": "Fable · male · British English",
222
+ "label": "Fable · male · British English · Kokoro q8f16",
223
223
  "language": "en-GB",
224
224
  "speakerId": 25
225
225
  },
226
226
  {
227
227
  "id": "bm_george",
228
- "label": "George · male · British English",
228
+ "label": "George · male · British English · Kokoro q8f16",
229
229
  "language": "en-GB",
230
230
  "speakerId": 26
231
231
  },
232
232
  {
233
233
  "id": "bm_lewis",
234
- "label": "Lewis · male · British English",
234
+ "label": "Lewis · male · British English · Kokoro q8f16",
235
235
  "language": "en-GB",
236
236
  "speakerId": 27
237
237
  }
@@ -57,43 +57,43 @@
57
57
  "voices": [
58
58
  {
59
59
  "id": "af_heart",
60
- "label": "Heart \u00b7 female \u00b7 American English",
60
+ "label": "Heart \u00b7 female \u00b7 American English \u00b7 Kokoro",
61
61
  "language": "en-US",
62
62
  "speakerId": 3
63
63
  },
64
64
  {
65
65
  "id": "af_bella",
66
- "label": "Bella \u00b7 female \u00b7 American English",
66
+ "label": "Bella \u00b7 female \u00b7 American English \u00b7 Kokoro",
67
67
  "language": "en-US",
68
68
  "speakerId": 2
69
69
  },
70
70
  {
71
71
  "id": "am_michael",
72
- "label": "Michael \u00b7 male \u00b7 American English",
72
+ "label": "Michael \u00b7 male \u00b7 American English \u00b7 Kokoro",
73
73
  "language": "en-US",
74
74
  "speakerId": 16
75
75
  },
76
76
  {
77
77
  "id": "am_adam",
78
- "label": "Adam \u00b7 male \u00b7 American English",
78
+ "label": "Adam \u00b7 male \u00b7 American English \u00b7 Kokoro",
79
79
  "language": "en-US",
80
80
  "speakerId": 11
81
81
  },
82
82
  {
83
83
  "id": "bf_emma",
84
- "label": "Emma \u00b7 female \u00b7 British English",
84
+ "label": "Emma \u00b7 female \u00b7 British English \u00b7 Kokoro",
85
85
  "language": "en-GB",
86
86
  "speakerId": 21
87
87
  },
88
88
  {
89
89
  "id": "bm_george",
90
- "label": "George \u00b7 male \u00b7 British English",
90
+ "label": "George \u00b7 male \u00b7 British English \u00b7 Kokoro",
91
91
  "language": "en-GB",
92
92
  "speakerId": 26
93
93
  },
94
94
  {
95
95
  "id": "bm_daniel",
96
- "label": "Daniel \u00b7 male \u00b7 British English",
96
+ "label": "Daniel \u00b7 male \u00b7 British English \u00b7 Kokoro",
97
97
  "language": "en-GB",
98
98
  "speakerId": 24
99
99
  }
@@ -99,35 +99,35 @@
99
99
  "voices": [
100
100
  {
101
101
  "id": "cori",
102
- "label": "Cori · female · British English",
102
+ "label": "Cori · female · British English · Piper",
103
103
  "speakerId": 0,
104
104
  "language": "en-GB",
105
105
  "modelId": "cori"
106
106
  },
107
107
  {
108
108
  "id": "alba",
109
- "label": "Alba · female · Scottish English",
109
+ "label": "Alba · female · Scottish English · Piper",
110
110
  "speakerId": 0,
111
111
  "language": "en-GB",
112
112
  "modelId": "alba"
113
113
  },
114
114
  {
115
115
  "id": "joe",
116
- "label": "Joe · male · American English",
116
+ "label": "Joe · male · American English · Piper",
117
117
  "speakerId": 0,
118
118
  "language": "en-US",
119
119
  "modelId": "joe"
120
120
  },
121
121
  {
122
122
  "id": "bryce",
123
- "label": "Bryce · male · American English",
123
+ "label": "Bryce · male · American English · Piper",
124
124
  "speakerId": 0,
125
125
  "language": "en-US",
126
126
  "modelId": "bryce"
127
127
  },
128
128
  {
129
129
  "id": "northern_english_male",
130
- "label": "Northern English · male · British English",
130
+ "label": "Northern English · male · British English · Piper",
131
131
  "speakerId": 0,
132
132
  "language": "en-GB",
133
133
  "modelId": "northern_english_male"
@@ -39,7 +39,7 @@
39
39
  "voices": [
40
40
  {
41
41
  "id": "cori",
42
- "label": "Cori \u00b7 female \u00b7 British English",
42
+ "label": "Cori \u00b7 female \u00b7 British English \u00b7 Piper",
43
43
  "speakerId": 0,
44
44
  "language": "en-GB"
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-voice-sherpa",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "description": "Optional native Sherpa speech engine and explicit model preparation for assistant voice.",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "tooling"
20
20
  ],
21
21
  "dependencies": {
22
- "@jskit-ai/assistant-voice": "0.1.8",
22
+ "@jskit-ai/assistant-voice": "0.1.9",
23
23
  "sherpa-onnx-node": "1.13.6"
24
24
  },
25
25
  "jskit": {
@@ -103,7 +103,7 @@ async function createSherpaSpeechEngine({
103
103
 
104
104
  const voices = configuration.voices || (configuration.synthesizer || configuration.synthesizers
105
105
  ? [{ id: "default", label: "Default voice", speakerId: 0 }]
106
- : [{ id: "cori", label: "Cori (British English)", language: "en-GB", speakerId: 0 }]);
106
+ : [{ id: "cori", label: "Cori · female · British English · Piper", language: "en-GB", speakerId: 0 }]);
107
107
  if (!Array.isArray(voices) || !voices.length || voices.length > 128 || new Set(voices.map(voice => voice?.id)).size !== voices.length ||
108
108
  voices.some(voice => !voice || !/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/u.test(voice.id) || typeof voice.label !== "string" || !voice.label.trim() || voice.label.length > 100 ||
109
109
  !Number.isSafeInteger(voice.speakerId) || voice.speakerId < 0)) {