``` python3 -m http.server 8000 ```
npm install wfloat-web```
python3 -m http.server 8000
Browser wrapper around sherpa-onnx (WASM).
This package ships large WASM artifacts that must be served as static files:
- sherpa-onnx-wasm-main-tts.jssherpa-onnx-wasm-main-tts.wasm
- sherpa-onnx-wasm-main-tts.data
-
Then, load the module at runtime:
`js
import { getModule, getSherpaOnnxVersion } from "wfloat-web";
const Module = await getModule({ baseUrl: "/wasm/wfloat/" });
console.log(getSherpaOnnxVersion(Module));
`
Don’t bundle sherpa-onnx-wasm-main-tts.js with esbuild. Serve the files under a stable URL (e.g. priv/static/wasm/wfloat/) and pass that URL as baseUrl`.