diff --git a/deps/binding.gyp b/deps/binding.gyp index 06bb045..37361e2 100644 --- a/deps/binding.gyp +++ b/deps/binding.gyp @@ -211,6 +211,7 @@ "opus/celt/arm/armcpu.c", "opus/celt/arm/celt_neon_intr.c", "opus/celt/arm/pitch_neon_intr.c", + "opus/silk/arm/LPC_inv_pred_gain_neon_intr.c", ], "include_dirs": [ "opus", diff --git a/package.json b/package.json index b40e71a..5bfe5dd 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "install": "node-pre-gyp install --fallback-to-build", "build": "node-pre-gyp install build package", "lint": "prettier --check . && eslint lib --format=pretty", - "lint:fix": "prettier --write . && eslint lib --fix --format=pretty" + "lint:fix": "prettier --write . && eslint lib --fix --format=pretty", + "test": "node tests/test.js" }, "keywords": [ "native", diff --git a/tests/frame.opus b/tests/frame.opus new file mode 100644 index 0000000..91961dc Binary files /dev/null and b/tests/frame.opus differ diff --git a/tests/test.js b/tests/test.js new file mode 100644 index 0000000..a870464 --- /dev/null +++ b/tests/test.js @@ -0,0 +1,13 @@ +const assert = require('node:assert'); +const fs = require('node:fs'); +const path = require('node:path'); +const { OpusEncoder } = require('../lib/index.js'); + +const opus = new OpusEncoder(16_000, 1); + +const frame = fs.readFileSync(path.join(__dirname, 'frame.opus')); + +const decoded = opus.decode(frame); + +assert(decoded.length === 640, 'Decoded frame length is not 640'); +console.log('Passed');