@sherpaw/vad-asr
v0.0.2
Published
A WebAssembly (WASM) wrapper for VAD + offline ASR with sherpa-onnx.
Readme
@sherpaw/vad-asr
A WebAssembly (WASM) wrapper for VAD + offline ASR with sherpa-onnx.
Quick start
import { CircularBuffer, createVad, initVADASRModule, OfflineRecognizer } from '@sherpaw/vad-asr'
const module = await initVADASRModule()
const vad = createVad(module, {
sileroVad: { model: './silero_vad.onnx' },
sampleRate: 16000,
numThreads: 1,
provider: 'cpu',
debug: 0,
bufferSizeInSeconds: 30,
})
const recognizer = new OfflineRecognizer(
{
modelConfig: {
tokens: './tokens.txt',
numThreads: 1,
provider: 'cpu',
debug: 0,
paraformer: { model: './paraformer.onnx' },
},
},
module,
)
const circularBuffer = new CircularBuffer(30 * 16000, module)Notes
- The prebuilt files are generated by the native build in
sherpa-onnx/:packages/vad-asr/src/prebuilt/vad-asr.jsandpackages/vad-asr/src/prebuilt/vad-asr.wasm. - Upstream VAD-ASR reference:
sherpa-onnx/upstream/wasm/vad-asr.
License
Copyright 2025 Makito
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.