node-web-audio-api 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +0 -2
- package/monkey-patch.js +4 -19
- package/node-web-audio-api.darwin-arm64.node +0 -0
- package/node-web-audio-api.darwin-x64.node +0 -0
- package/node-web-audio-api.linux-arm-gnueabihf.node +0 -0
- package/node-web-audio-api.linux-x64-gnu.node +0 -0
- package/node-web-audio-api.win32-arm64-msvc.node +0 -0
- package/node-web-audio-api.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## v0.12.0
|
|
2
|
+
|
|
3
|
+
- Update upstream crate to v0.33 (fix device number of channels > 32)
|
|
4
|
+
|
|
5
|
+
## v0.11.0
|
|
6
|
+
|
|
7
|
+
- Update upstream crate to v0.32
|
|
8
|
+
- Implement AudioDestination API
|
|
9
|
+
- Make decodeAudioData(arrayBuffer) API compliant (drop `load` helper)
|
|
10
|
+
|
|
1
11
|
## v0.10.0
|
|
2
12
|
|
|
3
13
|
- Update upstream crate to v0.31
|
package/README.md
CHANGED
|
@@ -64,8 +64,6 @@ npm run build
|
|
|
64
64
|
node examples/granular-scrub.mjs
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
If
|
|
68
|
-
|
|
69
67
|
## Caveats
|
|
70
68
|
|
|
71
69
|
- The async methods are not trully async for now and are just patched on the JS side. This will evolve once the "trully" async version of the methods are implemented in the upstream library.
|
package/monkey-patch.js
CHANGED
|
@@ -90,10 +90,9 @@ function patchAudioContext(nativeBinding) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
decodeAudioData(audioData) {
|
|
93
|
-
if (!
|
|
94
|
-
throw new Error(
|
|
93
|
+
if (!audioData instanceof ArrayBuffer) {
|
|
94
|
+
throw new Error('Invalid argument, please provide an ArrayBuffer');
|
|
95
95
|
}
|
|
96
|
-
|
|
97
96
|
try {
|
|
98
97
|
const audioBuffer = super.decodeAudioData(audioData);
|
|
99
98
|
return Promise.resolve(audioBuffer);
|
|
@@ -144,10 +143,9 @@ function patchOfflineAudioContext(nativeBinding) {
|
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
decodeAudioData(audioData) {
|
|
147
|
-
if (!
|
|
148
|
-
throw new Error(
|
|
146
|
+
if (!audioData instanceof ArrayBuffer) {
|
|
147
|
+
throw new Error('Invalid argument, please provide an ArrayBuffer');
|
|
149
148
|
}
|
|
150
|
-
|
|
151
149
|
try {
|
|
152
150
|
const audioBuffer = super.decodeAudioData(audioData);
|
|
153
151
|
return Promise.resolve(audioBuffer);
|
|
@@ -160,16 +158,6 @@ function patchOfflineAudioContext(nativeBinding) {
|
|
|
160
158
|
return OfflineAudioContext;
|
|
161
159
|
}
|
|
162
160
|
|
|
163
|
-
// dumb method provided to mock an xhr call and mimick browser's API
|
|
164
|
-
// see also `AudioContext.decodeAudioData`
|
|
165
|
-
function load(path) {
|
|
166
|
-
if (!fs.existsSync(path)) {
|
|
167
|
-
throw new Error(`File not found: "${path}"`);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return { path };
|
|
171
|
-
};
|
|
172
|
-
|
|
173
161
|
module.exports = function monkeyPatch(nativeBinding) {
|
|
174
162
|
nativeBinding.AudioContext = patchAudioContext(nativeBinding);
|
|
175
163
|
nativeBinding.OfflineAudioContext = patchOfflineAudioContext(nativeBinding);
|
|
@@ -192,8 +180,5 @@ module.exports = function monkeyPatch(nativeBinding) {
|
|
|
192
180
|
return Promise.resolve(stream);
|
|
193
181
|
}
|
|
194
182
|
|
|
195
|
-
// utils
|
|
196
|
-
nativeBinding.load = load;
|
|
197
|
-
|
|
198
183
|
return nativeBinding;
|
|
199
184
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|