Add WebAssembly example for VAD + Moonshine models. (#1535)

This commit is contained in:
Fangjun Kuang
2024-11-13 21:06:50 +08:00
committed by GitHub
parent 3f777b3fe3
commit 8436ba834c
3 changed files with 30 additions and 1 deletions

View File

@@ -111,6 +111,13 @@ function initOfflineRecognizer() {
};
} else if (fileExists('telespeech.onnx')) {
config.modelConfig.telespeechCtc = './telespeech.onnx';
} else if (fileExists('moonshine-preprocessor.onnx')) {
config.modelConfig.moonshine = {
preprocessor: './moonshine-preprocessor.onnx',
encoder: './moonshine-encoder.onnx',
uncachedDecoder: './moonshine-uncached-decoder.onnx',
cachedDecoder: './moonshine-cached-decoder.onnx'
};
} else {
console.log('Please specify a model.');
alert('Please specify a model.');