@suarify/kecil-tts 0.1.0 → 0.1.2

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
@@ -1,8 +1,13 @@
1
1
  # @suarify/kecil-tts
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@suarify/kecil-tts)](https://www.npmjs.com/package/@suarify/kecil-tts)
4
+ [![license](https://img.shields.io/npm/l/@suarify/kecil-tts)](LICENSE)
5
+
3
6
  Malay text-to-speech for **browsers and Node.js**, wrapped as an npm package around the
4
7
  [Kecil-TTS web Space](https://huggingface.co/spaces/Suarify/kecil-tts-web).
5
8
 
9
+ ![Browser test UI with voices, effects widget and code samples](https://raw.githubusercontent.com/suarify/kucing-tts-js/main/docs/screenshot.jpg)
10
+
6
11
  - Runs the 8 MB ONNX models locally with [transformers.js](https://github.com/huggingface/transformers.js) — no API key, no server required.
7
12
  - WebGPU in browsers (WASM fallback), CPU in Node.js.
8
13
  - Malay text normalization + G2P are bundled, so consumers ship no extra lexicon files.
@@ -136,10 +141,74 @@ const { audio, sampleRate } = await tts.speak('Selamat malam.');
136
141
 
137
142
  `Suaradee` is exported as a backwards-compatible alias of `KecilTTS`; `KecilTTS.from_pretrained(model)` also works.
138
143
 
139
- ## Client-side testing
144
+ ## Testing samples
140
145
 
141
146
  - [`sample/client-side-testing`](sample/client-side-testing) — zero-build browser page: voices/versions, buffered speech, streaming, effects presets, playback and WAV download.
142
147
  - [`sample/node-server-testing`](sample/node-server-testing) — small Node HTTP app using the library: `/voices`, `/effects` and `/speak` with speed + effects, driven by a browser page.
148
+ - [`sample/external-consumer-test`](sample/external-consumer-test) — standalone frontend that installs `@suarify/kecil-tts` from npm and runs every feature (15/15 ✓).
149
+ - [`sample/external-server-test`](sample/external-server-test) — standalone Node server that installs the package from npm; `node validate.mjs` prints raw JSON and frequency checks.
150
+
151
+ ## Validation logs
152
+
153
+ ### External browser consumer (installed from npm)
154
+
155
+ ```
156
+ ✓ DEFAULT_VOICE / DEFAULT_MODEL: yati, Suarify/kecil-tts-yati-v0.5.0
157
+ ✓ VOICES / VOICE_VERSIONS: 4 speakers, 14 versions
158
+ ✓ listVoices / listVersions: 4 speakers, 2 Nicole versions
159
+ ✓ resolveModel: Suarify/kecil-tts-yati-v0.4.1
160
+ ✓ normalize / createG2P / chunk: harɡa dua bəlas riŋɡit lima pu…, chunks=5
161
+ ✓ encodeWav / concatFloat32: 150 samples → 344 WAV bytes
162
+ ✓ listFxParameters / listFxPresets: 5 groups, 8 presets
163
+ ✓ applyEffects: 28200 shaped samples
164
+ ✓ runtimeInfo / checkOnnxRuntime: node=false, nativeOnnx=true
165
+ ✓ loadTTS: device=webgpu
166
+ ✓ KecilTTS / Suaradee alias: 28200 samples
167
+ ✓ speak: 147480 samples
168
+ ✓ speakPCM: 147480 samples
169
+ ✓ stream: 3 chunks
170
+ ✓ downloadWav: triggered
171
+ ```
172
+
173
+ ### External server consumer — `POST /test-all`
174
+
175
+ ```
176
+ ✓ DEFAULT_VOICE / DEFAULT_MODEL: yati, Suarify/kecil-tts-yati-v0.5.0
177
+ ✓ VOICES / VOICE_VERSIONS: 4 speakers, 14 versions
178
+ ✓ listVoices / listVersions: 4 speakers, 6 Yati versions
179
+ ✓ resolveModel: Suarify/kecil-tts-michael-v0.3.1
180
+ ✓ normalize / createG2P / G2P / chunk: harɡa dua bəlas riŋɡit lima …, chunks=7
181
+ ✓ encodeWav / concatFloat32: 150 samples → 344 WAV bytes
182
+ ✓ listFxParameters / listFxPresets / FX_DEFAULTS: 5 groups, 8 presets, 15 knobs
183
+ ✓ applyEffects: 0.4019
184
+ ✓ downloadWav guard (Node): correctly rejected with browser-only message
185
+ ✓ runtimeInfo / checkOnnxRuntime: nativeOnnx=false
186
+ ↷ model checks SKIPPED: A dynamic link library (DLL) initialization routine failed.
187
+ ```
188
+
189
+ `GET /health` on that machine:
190
+
191
+ ```json
192
+ { "ok": false, "runtime": { "ok": false, "nativeLoaded": false,
193
+ "error": "A dynamic link library (DLL) initialization routine failed. ... onnxruntime_binding.node",
194
+ "suggestion": "Use Node 20+ on a supported platform with a current Visual C++ runtime (Windows). If unavailable, run the model in a browser or use the Python package kecil_tts with onnxruntime." } }
195
+ ```
196
+
197
+ `POST /speak` returns `503` with the same guidance instead of crashing. Model inference was therefore **not** executed on that Windows host; the browser tests above did run real WebGPU inference.
198
+
199
+ ### Frequency / WAV validation (from `node validate.mjs`)
200
+
201
+ ```
202
+ SAMPLE_RATE constant: 24000 Hz
203
+ WAV header sample rate: 24000 Hz
204
+ WAV header byte rate: 48000 bytes/s
205
+ WAV data bytes: 48000 expected: 48000
206
+ input tone: 440 Hz
207
+ dominant freq (dry, zero-crossing): 440.00 Hz
208
+ dominant freq (dry, DFT peak): 440.00 Hz
209
+ dominant freq (effects applied): 440.00 Hz
210
+ audio duration: 1.000 s
211
+ ```
143
212
 
144
213
  ## Notes
145
214
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suarify/kecil-tts",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Malay text-to-speech in the browser or Node.js, powered by the Suarify Kecil-TTS ONNX models and transformers.js",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -15,6 +15,7 @@
15
15
  "files": [
16
16
  "src",
17
17
  "examples",
18
+ "docs/screenshot.jpg",
18
19
  "LICENSE",
19
20
  "NOTICE",
20
21
  "README.md"
@@ -46,7 +47,10 @@
46
47
  "type": "git",
47
48
  "url": "git+https://github.com/suarify/kucing-tts-js.git"
48
49
  },
49
- "homepage": "https://huggingface.co/spaces/Suarify/kecil-tts-web",
50
+ "bugs": {
51
+ "url": "https://github.com/suarify/kucing-tts-js/issues"
52
+ },
53
+ "homepage": "https://github.com/suarify/kucing-tts-js#readme",
50
54
  "publishConfig": {
51
55
  "access": "public"
52
56
  },
@@ -54,8 +58,5 @@
54
58
  "example": "examples",
55
59
  "test": "test"
56
60
  },
57
- "devDependencies": {},
58
- "bugs": {
59
- "url": "https://github.com/suarify/kucing-tts-js/issues"
60
- }
61
+ "devDependencies": {}
61
62
  }