react-native-audio-api 0.11.0-nightly-befc3c6-20251202 → 0.11.0-nightly-1ca2db9-20251204
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/android/src/main/cpp/audioapi/android/AudioAPIModule.cpp +0 -5
- package/android/src/main/cpp/audioapi/android/AudioAPIModule.h +0 -1
- package/android/src/main/java/com/swmansion/audioapi/AudioAPIModule.kt +1 -4
- package/common/cpp/audioapi/AudioAPIModuleInstaller.h +0 -17
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.cpp +11 -0
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +1 -0
- package/common/cpp/audioapi/HostObjects/effects/DelayNodeHostObject.cpp +27 -0
- package/common/cpp/audioapi/HostObjects/effects/DelayNodeHostObject.h +21 -0
- package/common/cpp/audioapi/core/AudioNode.cpp +4 -0
- package/common/cpp/audioapi/core/AudioNode.h +3 -0
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +7 -0
- package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
- package/common/cpp/audioapi/core/effects/ConvolverNode.cpp +1 -0
- package/common/cpp/audioapi/core/effects/DelayNode.cpp +101 -0
- package/common/cpp/audioapi/core/effects/DelayNode.h +39 -0
- package/common/cpp/audioapi/core/effects/IIRFilterNode.h +0 -1
- package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +3 -1
- package/common/cpp/test/src/DelayTest.cpp +108 -0
- package/ios/audioapi/ios/AudioAPIModule.mm +0 -2
- package/lib/commonjs/core/AudioNode.js +1 -1
- package/lib/commonjs/core/AudioNode.js.map +1 -1
- package/lib/commonjs/core/BaseAudioContext.js +5 -0
- package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
- package/lib/commonjs/core/DelayNode.js +17 -0
- package/lib/commonjs/core/DelayNode.js.map +1 -0
- package/lib/commonjs/web-core/AudioContext.js +4 -0
- package/lib/commonjs/web-core/AudioContext.js.map +1 -1
- package/lib/commonjs/web-core/DelayNode.js +17 -0
- package/lib/commonjs/web-core/DelayNode.js.map +1 -0
- package/lib/commonjs/web-core/OfflineAudioContext.js +4 -0
- package/lib/commonjs/web-core/OfflineAudioContext.js.map +1 -1
- package/lib/module/core/AudioNode.js +1 -1
- package/lib/module/core/AudioNode.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +5 -0
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/DelayNode.js +11 -0
- package/lib/module/core/DelayNode.js.map +1 -0
- package/lib/module/web-core/AudioContext.js +4 -0
- package/lib/module/web-core/AudioContext.js.map +1 -1
- package/lib/module/web-core/DelayNode.js +11 -0
- package/lib/module/web-core/DelayNode.js.map +1 -0
- package/lib/module/web-core/OfflineAudioContext.js +4 -0
- package/lib/module/web-core/OfflineAudioContext.js.map +1 -1
- package/lib/typescript/core/AudioNode.d.ts +2 -1
- package/lib/typescript/core/AudioNode.d.ts.map +1 -1
- package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/core/DelayNode.d.ts +9 -0
- package/lib/typescript/core/DelayNode.d.ts.map +1 -0
- package/lib/typescript/interfaces.d.ts +5 -0
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioContext.d.ts +2 -0
- package/lib/typescript/web-core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/BaseAudioContext.d.ts +2 -0
- package/lib/typescript/web-core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/DelayNode.d.ts +8 -0
- package/lib/typescript/web-core/DelayNode.d.ts.map +1 -0
- package/lib/typescript/web-core/OfflineAudioContext.d.ts +2 -0
- package/lib/typescript/web-core/OfflineAudioContext.d.ts.map +1 -1
- package/package.json +3 -8
- package/src/core/AudioNode.ts +4 -3
- package/src/core/BaseAudioContext.ts +6 -0
- package/src/core/DelayNode.ts +13 -0
- package/src/interfaces.ts +6 -0
- package/src/web-core/AudioContext.tsx +5 -0
- package/src/web-core/BaseAudioContext.tsx +2 -0
- package/src/web-core/DelayNode.tsx +12 -0
- package/src/web-core/OfflineAudioContext.tsx +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfflineAudioContext.d.ts","sourceRoot":"","sources":["../../../src/web-core/OfflineAudioContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAGtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"OfflineAudioContext.d.ts","sourceRoot":"","sources":["../../../src/web-core/OfflineAudioContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,oBAAoB,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EAAE,gCAAgC,GACzC,OAAO,CAAC,qBAAqB,CAAC;IAgBjC,YAAY,CACV,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,WAAW;IAwBd,kBAAkB,CAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,YAAY,EAClB,WAAW,CAAC,EAAE,uBAAuB,GACpC,YAAY;IAYf,cAAc,IAAI,YAAY;IAIxB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ3D,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAI/D,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAItC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-audio-api",
|
|
3
|
-
"version": "0.11.0-nightly-
|
|
3
|
+
"version": "0.11.0-nightly-1ca2db9-20251204",
|
|
4
4
|
"description": "react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification",
|
|
5
5
|
"bin": {
|
|
6
6
|
"setup-rn-audio-api-web": "./scripts/setup-rn-audio-api-web.js"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"type": "git",
|
|
73
73
|
"url": "git+https://github.com/software-mansion/react-native-audio-api.git"
|
|
74
74
|
},
|
|
75
|
-
"author": "Software Mansion
|
|
75
|
+
"author": "Software Mansion (https://github.com/software-mansion)",
|
|
76
76
|
"license": "MIT",
|
|
77
77
|
"bugs": {
|
|
78
78
|
"url": "https://github.com/software-mansion/react-native-audio-api/issues"
|
|
@@ -84,12 +84,7 @@
|
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"react": "*",
|
|
86
86
|
"react-native": "*",
|
|
87
|
-
"react-native-worklets": "
|
|
88
|
-
},
|
|
89
|
-
"peerDependenciesMeta": {
|
|
90
|
-
"react-native-worklets": {
|
|
91
|
-
"optional": true
|
|
92
|
-
}
|
|
87
|
+
"react-native-worklets": "*"
|
|
93
88
|
},
|
|
94
89
|
"devDependencies": {
|
|
95
90
|
"@babel/cli": "^7.20.0",
|
package/src/core/AudioNode.ts
CHANGED
|
@@ -23,7 +23,9 @@ export default class AudioNode {
|
|
|
23
23
|
this.channelInterpretation = this.node.channelInterpretation;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
public connect(destination: AudioNode
|
|
26
|
+
public connect(destination: AudioNode): AudioNode;
|
|
27
|
+
public connect(destination: AudioParam): void;
|
|
28
|
+
public connect(destination: AudioNode | AudioParam): AudioNode | void {
|
|
27
29
|
if (this.context !== destination.context) {
|
|
28
30
|
throw new InvalidAccessError(
|
|
29
31
|
'Source and destination are from different BaseAudioContexts'
|
|
@@ -34,9 +36,8 @@ export default class AudioNode {
|
|
|
34
36
|
this.node.connect(destination.audioParam);
|
|
35
37
|
} else {
|
|
36
38
|
this.node.connect(destination.node);
|
|
39
|
+
return destination;
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
return destination;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
public disconnect(destination?: AudioNode | AudioParam): void {
|
|
@@ -23,6 +23,7 @@ import AudioDestinationNode from './AudioDestinationNode';
|
|
|
23
23
|
import BiquadFilterNode from './BiquadFilterNode';
|
|
24
24
|
import ConstantSourceNode from './ConstantSourceNode';
|
|
25
25
|
import ConvolverNode from './ConvolverNode';
|
|
26
|
+
import DelayNode from './DelayNode';
|
|
26
27
|
import GainNode from './GainNode';
|
|
27
28
|
import IIRFilterNode from './IIRFilterNode';
|
|
28
29
|
import OscillatorNode from './OscillatorNode';
|
|
@@ -217,6 +218,11 @@ export default class BaseAudioContext {
|
|
|
217
218
|
return new GainNode(this, this.context.createGain());
|
|
218
219
|
}
|
|
219
220
|
|
|
221
|
+
createDelay(maxDelayTime?: number): DelayNode {
|
|
222
|
+
const maxTime = maxDelayTime ?? 1.0;
|
|
223
|
+
return new DelayNode(this, this.context.createDelay(maxTime));
|
|
224
|
+
}
|
|
225
|
+
|
|
220
226
|
createStereoPanner(): StereoPannerNode {
|
|
221
227
|
return new StereoPannerNode(this, this.context.createStereoPanner());
|
|
222
228
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IDelayNode } from '../interfaces';
|
|
2
|
+
import AudioNode from './AudioNode';
|
|
3
|
+
import AudioParam from './AudioParam';
|
|
4
|
+
import BaseAudioContext from './BaseAudioContext';
|
|
5
|
+
|
|
6
|
+
export default class DelayNode extends AudioNode {
|
|
7
|
+
readonly delayTime: AudioParam;
|
|
8
|
+
|
|
9
|
+
constructor(context: BaseAudioContext, delay: IDelayNode) {
|
|
10
|
+
super(context, delay);
|
|
11
|
+
this.delayTime = new AudioParam(delay.delayTime, context);
|
|
12
|
+
}
|
|
13
|
+
}
|
package/src/interfaces.ts
CHANGED
|
@@ -60,6 +60,7 @@ export interface IBaseAudioContext {
|
|
|
60
60
|
createOscillator(): IOscillatorNode;
|
|
61
61
|
createConstantSource(): IConstantSourceNode;
|
|
62
62
|
createGain(): IGainNode;
|
|
63
|
+
createDelay(maxDelayTime: number): IDelayNode;
|
|
63
64
|
createStereoPanner(): IStereoPannerNode;
|
|
64
65
|
createBiquadFilter: () => IBiquadFilterNode;
|
|
65
66
|
createIIRFilter: (
|
|
@@ -112,6 +113,11 @@ export interface IAudioNode {
|
|
|
112
113
|
disconnect: (destination?: IAudioNode | IAudioParam) => void;
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
export interface IDelayNode extends IAudioNode {
|
|
117
|
+
readonly delayTime: IAudioParam;
|
|
118
|
+
maxDelayTime: number;
|
|
119
|
+
}
|
|
120
|
+
|
|
115
121
|
export interface IGainNode extends IAudioNode {
|
|
116
122
|
readonly gain: IAudioParam;
|
|
117
123
|
}
|
|
@@ -18,6 +18,7 @@ import OscillatorNode from './OscillatorNode';
|
|
|
18
18
|
import PeriodicWave from './PeriodicWave';
|
|
19
19
|
import StereoPannerNode from './StereoPannerNode';
|
|
20
20
|
import ConvolverNode from './ConvolverNode';
|
|
21
|
+
import DelayNode from './DelayNode';
|
|
21
22
|
import { ConvolverNodeOptions } from './ConvolverNodeOptions';
|
|
22
23
|
|
|
23
24
|
import { globalWasmPromise, globalTag } from './custom/LoadCustomWasm';
|
|
@@ -66,6 +67,10 @@ export default class AudioContext implements BaseAudioContext {
|
|
|
66
67
|
return new GainNode(this, this.context.createGain());
|
|
67
68
|
}
|
|
68
69
|
|
|
70
|
+
createDelay(maxDelayTime?: number): DelayNode {
|
|
71
|
+
return new DelayNode(this, this.context.createDelay(maxDelayTime));
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
createStereoPanner(): StereoPannerNode {
|
|
70
75
|
return new StereoPannerNode(this, this.context.createStereoPanner());
|
|
71
76
|
}
|
|
@@ -15,6 +15,7 @@ import PeriodicWave from './PeriodicWave';
|
|
|
15
15
|
import StereoPannerNode from './StereoPannerNode';
|
|
16
16
|
import ConstantSourceNode from './ConstantSourceNode';
|
|
17
17
|
import ConvolverNode from './ConvolverNode';
|
|
18
|
+
import DelayNode from './DelayNode';
|
|
18
19
|
|
|
19
20
|
export default interface BaseAudioContext {
|
|
20
21
|
readonly context: globalThis.BaseAudioContext;
|
|
@@ -27,6 +28,7 @@ export default interface BaseAudioContext {
|
|
|
27
28
|
createOscillator(): OscillatorNode;
|
|
28
29
|
createConstantSource(): ConstantSourceNode;
|
|
29
30
|
createGain(): GainNode;
|
|
31
|
+
createDelay(maxDelayTime?: number): DelayNode;
|
|
30
32
|
createStereoPanner(): StereoPannerNode;
|
|
31
33
|
createBiquadFilter(): BiquadFilterNode;
|
|
32
34
|
createIIRFilter(options: IIRFilterNodeOptions): IIRFilterNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseAudioContext from './BaseAudioContext';
|
|
2
|
+
import AudioNode from './AudioNode';
|
|
3
|
+
import AudioParam from './AudioParam';
|
|
4
|
+
|
|
5
|
+
export default class DelayNode extends AudioNode {
|
|
6
|
+
readonly delayTime: AudioParam;
|
|
7
|
+
|
|
8
|
+
constructor(context: BaseAudioContext, delay: globalThis.DelayNode) {
|
|
9
|
+
super(context, delay);
|
|
10
|
+
this.delayTime = new AudioParam(delay.delayTime, context);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -22,6 +22,7 @@ import ConstantSourceNode from './ConstantSourceNode';
|
|
|
22
22
|
import { globalWasmPromise, globalTag } from './custom/LoadCustomWasm';
|
|
23
23
|
import ConvolverNode from './ConvolverNode';
|
|
24
24
|
import { ConvolverNodeOptions } from './ConvolverNodeOptions';
|
|
25
|
+
import DelayNode from './DelayNode';
|
|
25
26
|
|
|
26
27
|
export default class OfflineAudioContext implements BaseAudioContext {
|
|
27
28
|
readonly context: globalThis.OfflineAudioContext;
|
|
@@ -72,6 +73,10 @@ export default class OfflineAudioContext implements BaseAudioContext {
|
|
|
72
73
|
return new GainNode(this, this.context.createGain());
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
createDelay(maxDelayTime?: number): DelayNode {
|
|
77
|
+
return new DelayNode(this, this.context.createDelay(maxDelayTime));
|
|
78
|
+
}
|
|
79
|
+
|
|
75
80
|
createStereoPanner(): StereoPannerNode {
|
|
76
81
|
return new StereoPannerNode(this, this.context.createStereoPanner());
|
|
77
82
|
}
|