@node-3d/webaudio 6.0.0 → 6.0.2
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/dist/audio-buffer.d.ts +2 -2
- package/dist/audio-context.d.ts +2 -2
- package/dist/audio-destination-node.d.ts +1 -1
- package/dist/audio-listener.d.ts +2 -2
- package/dist/audio-node.d.ts +1 -1
- package/dist/audio-param.d.ts +2 -2
- package/dist/audio-scheduled-source-node.d.ts +1 -1
- package/dist/base-audio-context.d.ts +3 -3
- package/dist/core.d.ts +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +23 -23
- package/dist/native.d.ts +2 -1
- package/dist/nodes.d.ts +1 -1
- package/install.js +3 -2
- package/package.json +16 -15
- package/tsconfig.json +0 -30
package/dist/audio-buffer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
|
-
declare const AudioBuffer: import("./native.
|
|
2
|
+
declare const AudioBuffer: import("./native.js").TNativeEs5Constructor<[context: import("./native.js").TBaseAudioContext, source?: Readonly<{
|
|
3
3
|
length?: number;
|
|
4
4
|
numberOfChannels?: number;
|
|
5
5
|
sampleRate?: number;
|
|
6
|
-
}> | import("./native.
|
|
6
|
+
}> | import("./native.js").TNativeExternal | undefined], import("./native.js").TAudioBuffer>;
|
|
7
7
|
declare class JsAudioBuffer extends AudioBuffer {
|
|
8
8
|
[inspect.custom](): string;
|
|
9
9
|
toString(): string;
|
package/dist/audio-context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TJsBaseAudioContext } from './base-audio-context.
|
|
2
|
-
import type { TAudioContext, TAudioContextOptions, TNativeConstructor } from './native.
|
|
1
|
+
import type { TJsBaseAudioContext } from './base-audio-context.js';
|
|
2
|
+
import type { TAudioContext, TAudioContextOptions, TNativeConstructor } from './native.js';
|
|
3
3
|
declare const WrappedAudioContext: TNativeConstructor<[opts?: TAudioContextOptions], TAudioContext & TJsBaseAudioContext>;
|
|
4
4
|
export { WrappedAudioContext as AudioContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TAudioDestinationNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.
|
|
1
|
+
import type { TAudioDestinationNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.js';
|
|
2
2
|
type TAudioDestinationNodeConstructor = TNativeConstructor<[
|
|
3
3
|
ctx: TBaseAudioContext,
|
|
4
4
|
node: TNativeExternal
|
package/dist/audio-listener.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
|
-
import type { TBaseAudioContext, TNativeExternal } from './native.
|
|
3
|
-
declare const AudioListener: import("./native.
|
|
2
|
+
import type { TBaseAudioContext, TNativeExternal } from './native.js';
|
|
3
|
+
declare const AudioListener: import("./native.js").TNativeEs5Constructor<[context: TBaseAudioContext, listener: TNativeExternal, paramCtor: import("./native.js").TAudioParamConstructor], import("./native.js").TAudioListener>;
|
|
4
4
|
declare class JsAudioListener extends AudioListener {
|
|
5
5
|
constructor(ctx: TBaseAudioContext, listener: TNativeExternal);
|
|
6
6
|
[inspect.custom](): string;
|
package/dist/audio-node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TAudioNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.
|
|
1
|
+
import type { TAudioNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.js';
|
|
2
2
|
type TAudioNodeConstructor = TNativeConstructor<[
|
|
3
3
|
ctx: TBaseAudioContext,
|
|
4
4
|
node: TNativeExternal
|
package/dist/audio-param.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
|
-
import type { TAudioEventCallbackList } from './native.
|
|
3
|
-
declare const AudioParam: import("./native.
|
|
2
|
+
import type { TAudioEventCallbackList } from './native.js';
|
|
3
|
+
declare const AudioParam: import("./native.js").TAudioParamConstructor;
|
|
4
4
|
declare class JsAudioParam extends AudioParam {
|
|
5
5
|
get onerror(): TAudioEventCallbackList;
|
|
6
6
|
set onerror(cb: TAudioEventCallbackList);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TAudioScheduledSourceNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.
|
|
1
|
+
import type { TAudioScheduledSourceNode, TBaseAudioContext, TNativeConstructor, TNativeExternal } from './native.js';
|
|
2
2
|
type TAudioScheduledSourceNodeConstructor = TNativeConstructor<[
|
|
3
3
|
ctx: TBaseAudioContext,
|
|
4
4
|
node: TNativeExternal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AudioDestinationNode } from './audio-destination-node.
|
|
2
|
-
import { AudioListener } from './audio-listener.
|
|
3
|
-
import type { TAnalyserNode, TAudioBuffer, TAudioBufferSourceNode, TAudioNodeOptions, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TNativeConstructor, TNativeExternal, TOscillatorNode, TPannerNode } from './native.
|
|
1
|
+
import { AudioDestinationNode } from './audio-destination-node.js';
|
|
2
|
+
import { AudioListener } from './audio-listener.js';
|
|
3
|
+
import type { TAnalyserNode, TAudioBuffer, TAudioBufferSourceNode, TAudioNodeOptions, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TNativeConstructor, TNativeExternal, TOscillatorNode, TPannerNode } from './native.js';
|
|
4
4
|
export type TJsBaseAudioContext = TBaseAudioContext & {
|
|
5
5
|
_initListener: (destinationCtor: typeof AudioDestinationNode, listenerCtor: typeof AudioListener, sampleRate: number) => void;
|
|
6
6
|
createAnalyser: (opts?: TAudioNodeOptions) => TAnalyserNode;
|
package/dist/core.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { native } from './native.
|
|
1
|
+
export { native } from './native.js';
|
package/dist/events.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EventEmitter } from 'node:events';
|
|
2
|
-
import type { TAudioEventCallbackList } from './native.
|
|
2
|
+
import type { TAudioEventCallbackList } from './native.js';
|
|
3
3
|
export declare const setEventCallbacks: (emitter: EventEmitter, eventName: string, callbacks: TAudioEventCallbackList) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AudioBuffer } from './audio-buffer.
|
|
2
|
-
export { AudioContext } from './audio-context.
|
|
3
|
-
export { AudioParam } from './audio-param.
|
|
4
|
-
export * from './nodes.
|
|
5
|
-
export type * from './native.
|
|
1
|
+
export { AudioBuffer } from './audio-buffer.js';
|
|
2
|
+
export { AudioContext } from './audio-context.js';
|
|
3
|
+
export { AudioParam } from './audio-param.js';
|
|
4
|
+
export * from './nodes.js';
|
|
5
|
+
export type * from './native.js';
|
package/dist/index.js
CHANGED
|
@@ -111,14 +111,14 @@ class JsAudioParam extends AudioParam {
|
|
|
111
111
|
get onerror() {
|
|
112
112
|
return this.listeners('error');
|
|
113
113
|
}
|
|
114
|
-
set onerror(
|
|
115
|
-
setEventCallbacks(this, 'error',
|
|
114
|
+
set onerror(cb) {
|
|
115
|
+
setEventCallbacks(this, 'error', cb);
|
|
116
116
|
}
|
|
117
117
|
get onended() {
|
|
118
118
|
return this.listeners('ended');
|
|
119
119
|
}
|
|
120
|
-
set onended(
|
|
121
|
-
setEventCallbacks(this, 'ended',
|
|
120
|
+
set onended(cb) {
|
|
121
|
+
setEventCallbacks(this, 'ended', cb);
|
|
122
122
|
}
|
|
123
123
|
[audio_param_computedKey]() {
|
|
124
124
|
return this.toString();
|
|
@@ -274,14 +274,14 @@ const baseAudioContextPrototype = {
|
|
|
274
274
|
createBufferSource (opts = {}) {
|
|
275
275
|
return new nodes.AudioBufferSourceNode(this, opts);
|
|
276
276
|
},
|
|
277
|
-
createChannelMerger (
|
|
278
|
-
|
|
277
|
+
createChannelMerger () {
|
|
278
|
+
throw new Error('createChannelMerger is not implemented by this audio backend');
|
|
279
279
|
},
|
|
280
|
-
createChannelSplitter (
|
|
281
|
-
|
|
280
|
+
createChannelSplitter () {
|
|
281
|
+
throw new Error('createChannelSplitter is not implemented by this audio backend');
|
|
282
282
|
},
|
|
283
|
-
createConstantSource (
|
|
284
|
-
|
|
283
|
+
createConstantSource () {
|
|
284
|
+
throw new Error('createConstantSource is not implemented by this audio backend');
|
|
285
285
|
},
|
|
286
286
|
createConvolver (opts = {}) {
|
|
287
287
|
return new nodes.ConvolverNode(this, opts);
|
|
@@ -291,14 +291,14 @@ const baseAudioContextPrototype = {
|
|
|
291
291
|
maxDelayTime
|
|
292
292
|
});
|
|
293
293
|
},
|
|
294
|
-
createDynamicsCompressor (
|
|
295
|
-
|
|
294
|
+
createDynamicsCompressor () {
|
|
295
|
+
throw new Error('createDynamicsCompressor is not implemented by this audio backend');
|
|
296
296
|
},
|
|
297
297
|
createGain (opts = {}) {
|
|
298
298
|
return new nodes.GainNode(this, opts);
|
|
299
299
|
},
|
|
300
|
-
createIIRFilter (
|
|
301
|
-
|
|
300
|
+
createIIRFilter () {
|
|
301
|
+
throw new Error('createIIRFilter is not implemented by this audio backend');
|
|
302
302
|
},
|
|
303
303
|
createOscillator (opts = {}) {
|
|
304
304
|
return new nodes.OscillatorNode(this, opts);
|
|
@@ -306,21 +306,21 @@ const baseAudioContextPrototype = {
|
|
|
306
306
|
createPanner (opts = {}) {
|
|
307
307
|
return new nodes.PannerNode(this, opts);
|
|
308
308
|
},
|
|
309
|
-
createPeriodicWave (
|
|
310
|
-
|
|
309
|
+
createPeriodicWave () {
|
|
310
|
+
throw new Error('createPeriodicWave is not implemented by this audio backend');
|
|
311
311
|
},
|
|
312
|
-
createScriptProcessor (
|
|
313
|
-
|
|
312
|
+
createScriptProcessor () {
|
|
313
|
+
throw new Error('createScriptProcessor is not implemented by this audio backend');
|
|
314
314
|
},
|
|
315
|
-
createStereoPanner (
|
|
316
|
-
|
|
315
|
+
createStereoPanner () {
|
|
316
|
+
throw new Error('createStereoPanner is not implemented by this audio backend');
|
|
317
317
|
},
|
|
318
|
-
createWaveShaper (
|
|
319
|
-
|
|
318
|
+
createWaveShaper () {
|
|
319
|
+
throw new Error('createWaveShaper is not implemented by this audio backend');
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
base_audio_context_JsBaseAudioContext.prototype = baseAudioContextPrototype;
|
|
323
322
|
inherits(base_audio_context_JsBaseAudioContext, BaseAudioContext);
|
|
323
|
+
Object.defineProperties(base_audio_context_JsBaseAudioContext.prototype, Object.getOwnPropertyDescriptors(baseAudioContextPrototype));
|
|
324
324
|
function audio_context_to_primitive(input, hint) {
|
|
325
325
|
if ("object" !== audio_context_type_of(input) || null === input) return input;
|
|
326
326
|
var prim = input[Symbol.toPrimitive];
|
package/dist/native.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export type TAudioEvent = Readonly<{
|
|
|
5
5
|
type: string;
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
}>;
|
|
8
|
-
|
|
8
|
+
/** Event listener return values are ignored, matching Node's EventEmitter behavior. */
|
|
9
|
+
export type TAudioEventCallback<T extends TAudioEvent = TAudioEvent> = (event: T) => void;
|
|
9
10
|
export type TAudioEventCallbackList<T extends TAudioEvent = TAudioEvent> = TAudioEventCallback<T> | readonly TAudioEventCallback<T>[] | null | undefined;
|
|
10
11
|
export type TAudioContextState = 'closed' | 'interrupted' | 'running' | 'suspended';
|
|
11
12
|
export type TChannelCountMode = 'clamped-max' | 'explicit' | 'max';
|
package/dist/nodes.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TAnalyserNode, TAudioBufferSourceNode, TAudioNode, TAudioNodeOptions, TAudioScheduledSourceNode, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TOscillatorNode, TPannerNode } from './native.
|
|
1
|
+
import type { TAnalyserNode, TAudioBufferSourceNode, TAudioNode, TAudioNodeOptions, TAudioScheduledSourceNode, TBaseAudioContext, TBiquadFilterNode, TConvolverNode, TDelayNode, TGainNode, TOscillatorNode, TPannerNode } from './native.js';
|
|
2
2
|
type TNodeConstructor<TInstance extends object = TAudioNode> = new (ctx: TBaseAudioContext, opts?: TAudioNodeOptions) => TInstance;
|
|
3
3
|
type TExportedNodeName = 'AnalyserNode' | 'AudioBufferSourceNode' | 'AudioScheduledSourceNode' | 'BiquadFilterNode' | 'ConvolverNode' | 'DelayNode' | 'GainNode' | 'OscillatorNode' | 'PannerNode';
|
|
4
4
|
type TNodeMap = {
|
package/install.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import packageJson from './package.json' with { type: 'json' };
|
|
2
|
+
import { getInstallCandidateUrl, install } from '@node-3d/addon-tools';
|
|
2
3
|
|
|
3
4
|
const prefix = 'https://github.com/node-3d/webaudio/releases/download';
|
|
4
5
|
const tag = '6.0.0';
|
|
5
6
|
|
|
6
|
-
await install(`${prefix}/${tag}`);
|
|
7
|
+
await install(getInstallCandidateUrl(packageJson.name) || `${prefix}/${tag}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Luis Blanco <luisblanco1337@gmail.com>",
|
|
3
3
|
"name": "@node-3d/webaudio",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.2",
|
|
5
5
|
"description": "Web Audio for Node.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -19,15 +19,14 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
21
|
"install.js",
|
|
22
|
-
"LICENSE"
|
|
23
|
-
"package.json",
|
|
24
|
-
"tsconfig.json"
|
|
22
|
+
"LICENSE"
|
|
25
23
|
],
|
|
26
24
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
28
|
-
"npm": ">=
|
|
25
|
+
"node": ">=22.18.0",
|
|
26
|
+
"npm": ">=10.9.0"
|
|
29
27
|
},
|
|
30
28
|
"scripts": {
|
|
29
|
+
"i": "npm install --workspaces=false",
|
|
31
30
|
"postinstall": "node install.js",
|
|
32
31
|
"build:rebuild": "cd src && node-gyp rebuild -j max && node -e \"import('@node-3d/addon-tools').then((m) => m.cpbin('webaudio'))\"",
|
|
33
32
|
"build:compile": "cd src && node-gyp build -j max && node -e \"import('@node-3d/addon-tools').then((m) => m.cpbin('webaudio'))\"",
|
|
@@ -50,19 +49,21 @@
|
|
|
50
49
|
"url": "git+https://github.com/node-3d/webaudio.git"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
|
-
"@node-3d/addon-tools": "~10.0
|
|
54
|
-
"@node-3d/deps-labsound": "~7.0.
|
|
55
|
-
"@node-3d/segfault": "~4.0.
|
|
52
|
+
"@node-3d/addon-tools": "~10.2.0",
|
|
53
|
+
"@node-3d/deps-labsound": "~7.0.2",
|
|
54
|
+
"@node-3d/segfault": "~4.0.3"
|
|
56
55
|
},
|
|
57
56
|
"devDependencies": {
|
|
58
|
-
"@types/node": "24.
|
|
59
|
-
"node-addon-api": "8.9.
|
|
60
|
-
"
|
|
57
|
+
"@types/node": "24.19.0",
|
|
58
|
+
"node-addon-api": "8.9.2",
|
|
59
|
+
"node-gyp": "12.4.0",
|
|
60
|
+
"oxlint": "1.85.0",
|
|
61
|
+
"oxlint-tsgolint": "7.0.2003",
|
|
61
62
|
"tslib": "2.8.1",
|
|
62
|
-
"@rslib/core": "0.
|
|
63
|
-
"oxfmt": "0.
|
|
63
|
+
"@rslib/core": "1.0.2",
|
|
64
|
+
"oxfmt": "0.70.0",
|
|
64
65
|
"typescript": "7.0.2",
|
|
65
|
-
"clang-format-node": "
|
|
66
|
+
"clang-format-node": "4.0.1"
|
|
66
67
|
},
|
|
67
68
|
"type": "module",
|
|
68
69
|
"types": "dist/index.d.ts",
|
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2024",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"allowImportingTsExtensions": true,
|
|
8
|
-
"rewriteRelativeImportExtensions": true,
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"declarationMap": false,
|
|
11
|
-
"sourceMap": false,
|
|
12
|
-
"rootDir": ".",
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"paths": {
|
|
15
|
-
"@node-3d/webaudio": [
|
|
16
|
-
"./ts/index.ts"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"verbatimModuleSyntax": true,
|
|
20
|
-
"skipLibCheck": true,
|
|
21
|
-
"types": [
|
|
22
|
-
"node"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"*.ts",
|
|
27
|
-
"ts/**/*.ts",
|
|
28
|
-
"examples/**/*.ts"
|
|
29
|
-
]
|
|
30
|
-
}
|