| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This is an addon demo that can perform whisper model reasoning in node and electron environments, based on cmake-js. It can be used as a reference for using the whisper.cpp project in other node projects.
This addon now supports Voice Activity Detection (VAD) for improved transcription performance.
npm installMake sure it is in the project root directory and compiled with make-js.
npx cmake-js compile -T addon.node -B ReleaseFor Electron addon and cmake-js options, you can see cmake-js and make very few configuration changes.
Such as appointing special cmake path:
npx cmake-js compile -c 'xxx/cmake' -T addon.node -B Release
cd examples/addon.node
node index.js --language='language' --model='model-path' --fname_inp='file-path'Run the VAD example with performance comparison:
node vad-example.jsVAD can significantly improve transcription performance by only processing speech segments, which is especially beneficial for audio files with long periods of silence.
Before using VAD, download a VAD model:
# From the whisper.cpp root directory
./models/download-vad-model.sh silero-v6.2.0All VAD parameters are optional and have sensible defaults:
const path = require("path");
const { whisper } = require(path.join(__dirname, "../../build/Release/addon.node"));
const { promisify } = require("util");
const whisperAsync = promisify(whisper);
// With VAD enabled
const vadParams = {
language: "en",
model: path.join(__dirname, "../../models/ggml-base.en.bin"),
fname_inp: path.join(__dirname, "../../samples/jfk.wav"),
vad: true,
vad_model: path.join(__dirname, "../../models/ggml-silero-v6.2.0.bin"),
vad_threshold: 0.5,
progress_callback: (progress) => console.log(`Progress: ${progress}%`)
};
whisperAsync(vadParams).then(result => console.log(result));Both traditional whisper.cpp parameters and new VAD parameters are supported:
| Back | FazBrowse Home | New Git URL |