Skip to content

Commit

Permalink
Add max_len params in node addon
Browse files Browse the repository at this point in the history
  • Loading branch information
billyct authored Jan 24, 2025
1 parent 7ffcd05 commit 3f6e05c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/addon.node/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ Napi::Value whisper(const Napi::CallbackInfo& info) {
bool no_timestamps = whisper_params.Get("no_timestamps").As<Napi::Boolean>();
int32_t audio_ctx = whisper_params.Get("audio_ctx").As<Napi::Number>();
bool comma_in_time = whisper_params.Get("comma_in_time").As<Napi::Boolean>();
int32_t max_len = whisper_params.Get("max_len").As<Napi::Number>();

Napi::Value pcmf32Value = whisper_params.Get("pcmf32");
std::vector<float> pcmf32_vec;
Expand All @@ -352,6 +353,7 @@ Napi::Value whisper(const Napi::CallbackInfo& info) {
params.audio_ctx = audio_ctx;
params.pcmf32 = pcmf32_vec;
params.comma_in_time = comma_in_time;
params.max_len = max_len;

Napi::Function callback = info[1].As<Napi::Function>();
Worker* worker = new Worker(callback, params);
Expand Down

0 comments on commit 3f6e05c

Please sign in to comment.