Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix node-addaon-api for vad #932

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/node-addon/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"

# SHERPA_ONNX_VERSION=1.0.27
# SHERPA_ONNX_VERSION=1.0.28

if [ -z $owner ]; then
owner=k2-fsa
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
# SHERPA_ONNX_VERSION=1.0.27
# SHERPA_ONNX_VERSION=1.0.28

src_dir=.github/scripts/node-addon
sed -i.bak s/SHERPA_ONNX_VERSION/$SHERPA_ONNX_VERSION/g $src_dir/package.json
Expand Down
4 changes: 2 additions & 2 deletions scripts/node-addon-api/src/vad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ static Napi::Float32Array CircularBufferGetWrapper(
return float32Array;
} else {
// don't use external buffer
Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(
env, const_cast<float *>(data), sizeof(float) * n);
Napi::ArrayBuffer arrayBuffer =
Napi::ArrayBuffer::New(env, sizeof(float) * n);

Napi::Float32Array float32Array =
Napi::Float32Array::New(env, n, arrayBuffer, 0);
Expand Down
2 changes: 1 addition & 1 deletion scripts/node-addon-api/src/wave-writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static Napi::Boolean WriteWaveWrapper(const Napi::CallbackInfo &info) {

if (info.Length() != 2) {
std::ostringstream os;
os << "Expect only 2 argument2. Given: " << info.Length();
os << "Expect only 2 arguments. Given: " << info.Length();

Napi::TypeError::New(env, os.str()).ThrowAsJavaScriptException();

Expand Down
Loading