whisper.cpp/examples/addon.node
Lin Xiaodong e853620270
addon.node : support max_context api for addon.node (#3025)
* feat: support max content

* feat: show api in test file

---------

Co-authored-by: linxiaodong <calm.lin@wukongsch.com>
2025-04-11 06:36:38 +02:00
..
__test__ addon.node : support max_context api for addon.node (#3025) 2025-04-11 06:36:38 +02:00
.gitignore addon.node : using whisper as a Node.js addon (#443) 2023-02-04 09:10:25 +02:00
addon.cpp addon.node : support max_context api for addon.node (#3025) 2025-04-11 06:36:38 +02:00
CMakeLists.txt examples : fix node compilation (#2115) 2024-05-02 22:52:55 +01:00
index.js examples : support progress_callback API for addon.node (#2941) 2025-03-28 06:34:26 +01:00
package.json examples : fix node compilation (#2115) 2024-05-02 22:52:55 +01:00
README.md examples : fix node compilation (#2115) 2024-05-02 22:52:55 +01:00

addon

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.

Install

npm install

Compile

Make sure it is in the project root directory and compiled with make-js.

npx cmake-js compile -T addon.node -B Release

For 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

Run

cd examples/addon.node

node index.js --language='language' --model='model-path' --fname_inp='file-path'

Because this is a simple Demo, only the above parameters are set in the node environment.

Other parameters can also be specified in the node environment.