Skip to content

Commit e23d60c

Browse files
committed
feat(bindings): Expand Node.js and Python bindings with full feature and effects API
Node.js native addon (sonare_wrap.cpp / sonare_wrap.h): - Add effects: hpss, harmonic, percussive, timeStretch, pitchShift, normalize, trim - Add spectrogram features: stft, stftDb, melSpectrogram, mfcc, chroma - Add spectral features: spectralCentroid, spectralBandwidth, spectralRolloff, spectralFlatness, zeroCrossingRate, rmsEnergy - Add pitch features: pitchYin, pitchPyin - Add core utilities: hz/mel/midi/note conversions, framesToTime, timeToFrames, resample - Add VecToFloat32 helper for efficient vector-to-typed-array transfer - Promote all analysis methods onto the Audio class in index.ts - Add structured result types (StftResult, MelSpectrogramResult, MfccResult, ChromaResult, HpssResult, PitchResult, StftDbResult) in types.ts - Consolidate biome.json into root config; upgrade to Biome 2.4.8, TypeScript 6, Vitest 4; add yarn.lock and .gitignore Python cffi bindings (libsonare/): - Mirror new features in _ffi.py, analyzer.py, audio.py, and types.py - Expand test_analyzer.py to cover new APIs C API (sonare_c.h / sonare_c.cpp): - Expose new feature and effects entry points used by both Node and Python bindings WASM (wasm/bindings.cpp, js/index.ts): - Expose matching feature functions via embind - Add tests/wasm/features.test.ts with WASM feature coverage - Expand tests/wasm/streaming.test.ts
1 parent 3e8d604 commit e23d60c

24 files changed

Lines changed: 8052 additions & 779 deletions

bindings/node/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
dist/
3+
build/
4+
.yarn/*
5+
!.yarn/patches
6+
!.yarn/plugins
7+
!.yarn/releases
8+
!.yarn/sdks
9+
!.yarn/versions

bindings/node/biome.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

bindings/node/package.json

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,36 @@
55
"type": "module",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",
8-
"files": ["dist/", "build/Release/*.node"],
8+
"files": [
9+
"dist/",
10+
"build/Release/*.node"
11+
],
912
"scripts": {
1013
"build:native": "cmake-js compile",
11-
"build": "npm run build:native && tsc",
12-
"check": "biome check src/ tests/",
13-
"check:fix": "biome check --write src/ tests/",
14+
"build": "yarn build:native && tsc",
15+
"lint": "biome check src/ tests/",
16+
"lint:fix": "biome check --write src/ tests/",
17+
"format": "biome format --write src/ tests/",
1418
"test": "vitest run",
1519
"test:watch": "vitest"
1620
},
1721
"license": "Apache-2.0",
18-
"engines": { "node": ">=22" },
22+
"engines": {
23+
"node": ">=22"
24+
},
1925
"packageManager": "yarn@4.12.0",
20-
"volta": { "node": "22.21.1", "yarn": "4.12.0" },
26+
"volta": {
27+
"node": "22.21.1",
28+
"yarn": "4.12.0"
29+
},
2130
"dependencies": {
2231
"cmake-js": "^7.3.0",
2332
"node-addon-api": "^8.0.0"
2433
},
2534
"devDependencies": {
26-
"@biomejs/biome": "^1.9.0",
35+
"@biomejs/biome": "^2.4.8",
2736
"@types/node": "^22.0.0",
28-
"@vitest/coverage-v8": "2",
29-
"typescript": "^5.5.0",
30-
"vitest": "^2.0.0"
37+
"typescript": "^6.0.2",
38+
"vitest": "^4.1.1"
3139
}
3240
}

0 commit comments

Comments
 (0)