node-web-audio-api 1.0.3 → 1.0.7
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 +8 -0
- package/README.md +4 -3
- package/index.mjs +39 -43
- package/js/AudioWorkletNode.js +1 -1
- 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-arm64-gnu.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 +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/node-web-audio-api)
|
|
4
4
|
|
|
5
|
-
Node.js bindings for the Rust implementation of the [Web Audio API](https://www.w3.org/TR/webaudio/).
|
|
5
|
+
Node.js bindings for the Rust implementation of the [Web Audio API specification](https://www.w3.org/TR/webaudio/).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The library aims to provide an implementation that is both efficient and compliant with the specification.
|
|
8
8
|
|
|
9
9
|
- see [`orottier/web-audio-api-rs`](https://github.com/orottier/web-audio-api-rs/) for the "real" audio guts
|
|
10
10
|
- use [`napi-rs`](https://github.com/napi-rs/napi-rs/) for the Node.js bindings
|
|
11
11
|
|
|
12
|
-
For library authors who
|
|
12
|
+
For library authors who want to write components that run both in Node.js and the browser, we also provide [isomorphic-web-audio-api](https://github.com/ircam-ismm/isomorphic-web-audio-api).
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
@@ -69,6 +69,7 @@ node examples/granular-scrub.js
|
|
|
69
69
|
|
|
70
70
|
- `AudioBuffer#getChannelData` is implemented but not reliable in some situations. Your should prefer `AudioBuffer#copyToChannel` and `AudioBuffer#copyFromChannel` when you want to access or manipulate the underlying samples in a safe way.
|
|
71
71
|
- `Streams`: only a minimal audio input stream and the `MediaStreamSourceNode` are provided. All other `MediaStream` features are left on the side for now as they principally concern a different API specification, which is not a trivial problem.
|
|
72
|
+
- `new AudioContext({sinkId:{type:'none'}})`: if your system has no audio sinks (e.g. docker image) use `{sinkId:{type:'none'}}` when initializing `AudioContext`, else it will crash with `DeviceNotAvailable` [see MDN](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext#sinkid)
|
|
72
73
|
|
|
73
74
|
## Supported Platforms - Prebuilt Binaries
|
|
74
75
|
|
package/index.mjs
CHANGED
|
@@ -26,50 +26,46 @@ import {
|
|
|
26
26
|
const require = createRequire(import.meta.url);
|
|
27
27
|
|
|
28
28
|
const nativeModule = require('./index.cjs');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
// events
|
|
30
|
+
export const OfflineAudioCompletionEvent = nativeModule.OfflineAudioCompletionEvent;
|
|
31
|
+
export const AudioProcessingEvent = nativeModule.AudioProcessingEvent;
|
|
32
|
+
export const AudioRenderCapacityEvent = nativeModule.AudioRenderCapacityEvent;
|
|
33
|
+
// manually written nodes
|
|
34
|
+
export const BaseAudioContext = nativeModule.BaseAudioContext;
|
|
35
|
+
export const AudioContext = nativeModule.AudioContext;
|
|
36
|
+
export const OfflineAudioContext = nativeModule.OfflineAudioContext;
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
export const AudioNode = nativeModule.AudioNode;
|
|
39
|
+
export const AudioScheduledSourceNode = nativeModule.AudioScheduledSourceNode;
|
|
40
|
+
export const AudioParam = nativeModule.AudioParam;
|
|
41
|
+
export const AudioDestinationNode = nativeModule.AudioDestinationNode;
|
|
42
|
+
export const AudioListener = nativeModule.AudioListener;
|
|
43
|
+
export const AudioWorklet = nativeModule.AudioWorklet;
|
|
44
|
+
export const AudioParamMap = nativeModule.AudioParamMap;
|
|
45
|
+
export const AudioRenderCapacity = nativeModule.AudioRenderCapacity;
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
GainNode,
|
|
64
|
-
IIRFilterNode,
|
|
65
|
-
MediaStreamAudioSourceNode,
|
|
66
|
-
OscillatorNode,
|
|
67
|
-
PannerNode,
|
|
68
|
-
StereoPannerNode,
|
|
69
|
-
WaveShaperNode,
|
|
70
|
-
|
|
71
|
-
// helper methods
|
|
72
|
-
mediaDevices,
|
|
73
|
-
} = nativeModule;
|
|
47
|
+
export const PeriodicWave = nativeModule.PeriodicWave;
|
|
48
|
+
export const AudioBuffer = nativeModule.AudioBuffer;
|
|
49
|
+
// generated nodes
|
|
50
|
+
export const ScriptProcessorNode = nativeModule.ScriptProcessorNode;
|
|
51
|
+
export const AudioWorkletNode = nativeModule.AudioWorkletNode;
|
|
52
|
+
export const AnalyserNode = nativeModule.AnalyserNode;
|
|
53
|
+
export const AudioBufferSourceNode = nativeModule.AudioBufferSourceNode;
|
|
54
|
+
export const BiquadFilterNode = nativeModule.BiquadFilterNode;
|
|
55
|
+
export const ChannelMergerNode = nativeModule.ChannelMergerNode;
|
|
56
|
+
export const ChannelSplitterNode = nativeModule.ChannelSplitterNode;
|
|
57
|
+
export const ConstantSourceNode = nativeModule.ConstantSourceNode;
|
|
58
|
+
export const ConvolverNode = nativeModule.ConvolverNode;
|
|
59
|
+
export const DelayNode = nativeModule.DelayNode;
|
|
60
|
+
export const DynamicsCompressorNode = nativeModule.DynamicsCompressorNode;
|
|
61
|
+
export const GainNode = nativeModule.GainNode;
|
|
62
|
+
export const IIRFilterNode = nativeModule.IIRFilterNode;
|
|
63
|
+
export const MediaStreamAudioSourceNode = nativeModule.MediaStreamAudioSourceNode;
|
|
64
|
+
export const OscillatorNode = nativeModule.OscillatorNode;
|
|
65
|
+
export const PannerNode = nativeModule.PannerNode;
|
|
66
|
+
export const StereoPannerNode = nativeModule.StereoPannerNode;
|
|
67
|
+
export const WaveShaperNode = nativeModule.WaveShaperNode;
|
|
68
|
+
// helper methods
|
|
69
|
+
export const mediaDevices = nativeModule.mediaDevices;
|
|
74
70
|
|
|
75
71
|
export default nativeModule;
|
package/js/AudioWorkletNode.js
CHANGED
|
@@ -114,7 +114,7 @@ module.exports = (jsExport, nativeBinding) => {
|
|
|
114
114
|
if (typeof options.parameterData === 'object' && options.parameterData !== null) {
|
|
115
115
|
parsedOptions.parameterData = {};
|
|
116
116
|
|
|
117
|
-
for (let [key, value]
|
|
117
|
+
for (let [key, value] of Object.entries(options.parameterData)) {
|
|
118
118
|
const parsedKey = conversions['DOMString'](key, {
|
|
119
119
|
context: `Failed to construct 'AudioWorkletNode': Invalid 'parameterData' property from AudioWorkletNodeOptions: Invalid key (${key})`,
|
|
120
120
|
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-web-audio-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"author": "Benjamin Matuszewski",
|
|
5
5
|
"description": "Web Audio API implementation for Node.js",
|
|
6
6
|
"exports": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"check": "cargo fmt && cargo clippy",
|
|
43
43
|
"generate": "node generator/index.mjs && cargo fmt",
|
|
44
44
|
"lint": "npx eslint index.cjs index.mjs && npx eslint js/*.js && npx eslint examples/*.js",
|
|
45
|
-
"preversion": "npm install && npm run generate",
|
|
45
|
+
"preversion": "npm install && npm run generate && npm run lint",
|
|
46
46
|
"postversion": "cargo bump $npm_package_version && git commit -am \"v$npm_package_version\" && node .scripts/check-changelog.mjs",
|
|
47
47
|
"test": "mocha tests/*.spec.mjs",
|
|
48
48
|
"test:ci": "mocha tests/*.spec.mjs -- --ci",
|