react-native-audio-api 0.11.0-nightly-0d7455c-20251203 → 0.11.0-nightly-db51488-20251205

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.
Files changed (65) hide show
  1. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.cpp +11 -0
  2. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +1 -0
  3. package/common/cpp/audioapi/HostObjects/effects/DelayNodeHostObject.cpp +27 -0
  4. package/common/cpp/audioapi/HostObjects/effects/DelayNodeHostObject.h +21 -0
  5. package/common/cpp/audioapi/core/AudioNode.cpp +4 -0
  6. package/common/cpp/audioapi/core/AudioNode.h +3 -0
  7. package/common/cpp/audioapi/core/BaseAudioContext.cpp +7 -0
  8. package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
  9. package/common/cpp/audioapi/core/effects/ConvolverNode.cpp +1 -0
  10. package/common/cpp/audioapi/core/effects/DelayNode.cpp +101 -0
  11. package/common/cpp/audioapi/core/effects/DelayNode.h +39 -0
  12. package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +3 -1
  13. package/common/cpp/test/src/DelayTest.cpp +108 -0
  14. package/lib/commonjs/core/AudioNode.js +1 -1
  15. package/lib/commonjs/core/AudioNode.js.map +1 -1
  16. package/lib/commonjs/core/BaseAudioContext.js +5 -0
  17. package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
  18. package/lib/commonjs/core/DelayNode.js +17 -0
  19. package/lib/commonjs/core/DelayNode.js.map +1 -0
  20. package/lib/commonjs/web-core/AudioContext.js +4 -0
  21. package/lib/commonjs/web-core/AudioContext.js.map +1 -1
  22. package/lib/commonjs/web-core/DelayNode.js +17 -0
  23. package/lib/commonjs/web-core/DelayNode.js.map +1 -0
  24. package/lib/commonjs/web-core/OfflineAudioContext.js +4 -0
  25. package/lib/commonjs/web-core/OfflineAudioContext.js.map +1 -1
  26. package/lib/module/core/AudioNode.js +1 -1
  27. package/lib/module/core/AudioNode.js.map +1 -1
  28. package/lib/module/core/BaseAudioContext.js +5 -0
  29. package/lib/module/core/BaseAudioContext.js.map +1 -1
  30. package/lib/module/core/DelayNode.js +11 -0
  31. package/lib/module/core/DelayNode.js.map +1 -0
  32. package/lib/module/web-core/AudioContext.js +4 -0
  33. package/lib/module/web-core/AudioContext.js.map +1 -1
  34. package/lib/module/web-core/DelayNode.js +11 -0
  35. package/lib/module/web-core/DelayNode.js.map +1 -0
  36. package/lib/module/web-core/OfflineAudioContext.js +4 -0
  37. package/lib/module/web-core/OfflineAudioContext.js.map +1 -1
  38. package/lib/typescript/core/AudioNode.d.ts +2 -1
  39. package/lib/typescript/core/AudioNode.d.ts.map +1 -1
  40. package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
  41. package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
  42. package/lib/typescript/core/DelayNode.d.ts +9 -0
  43. package/lib/typescript/core/DelayNode.d.ts.map +1 -0
  44. package/lib/typescript/interfaces.d.ts +5 -0
  45. package/lib/typescript/interfaces.d.ts.map +1 -1
  46. package/lib/typescript/web-core/AudioContext.d.ts +2 -0
  47. package/lib/typescript/web-core/AudioContext.d.ts.map +1 -1
  48. package/lib/typescript/web-core/BaseAudioContext.d.ts +2 -0
  49. package/lib/typescript/web-core/BaseAudioContext.d.ts.map +1 -1
  50. package/lib/typescript/web-core/DelayNode.d.ts +8 -0
  51. package/lib/typescript/web-core/DelayNode.d.ts.map +1 -0
  52. package/lib/typescript/web-core/OfflineAudioContext.d.ts +2 -0
  53. package/lib/typescript/web-core/OfflineAudioContext.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/src/core/AudioNode.ts +4 -3
  56. package/src/core/BaseAudioContext.ts +6 -0
  57. package/src/core/DelayNode.ts +13 -0
  58. package/src/interfaces.ts +6 -0
  59. package/src/web-core/AudioContext.tsx +5 -0
  60. package/src/web-core/BaseAudioContext.tsx +2 -0
  61. package/src/web-core/DelayNode.tsx +12 -0
  62. package/src/web-core/OfflineAudioContext.tsx +5 -0
  63. package/metro-config/index.d.ts +0 -5
  64. package/metro-config/index.js +0 -41
  65. package/metro-config/tsconfig.json +0 -3
@@ -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
  }
@@ -1,5 +0,0 @@
1
- import type { MetroConfig } from '@react-native/metro-config/dist';
2
-
3
- export declare function wrapWithAudioAPIMetroConfig(
4
- config: MetroConfig
5
- ): MetroConfig;
@@ -1,41 +0,0 @@
1
- const COLLAPSED_STACK_REGEX = new RegExp(
2
- [
3
- // For internal usage in the example app
4
- '/packages/react-native-audio-api/.+\\.(t|j)sx?$',
5
- // When audio-api is installed as a dependency (node_modules)
6
- '/node_modules/react-native-audio-api/.+\\.(t|j)sx?$',
7
- ]
8
- // Make patterns work with both Windows and POSIX paths.
9
- .map((pathPattern) => pathPattern.replaceAll('/', '[/\\\\]'))
10
- .join('|')
11
- );
12
-
13
- /**
14
- * Wraps and returns a modified Metro configuration to handle stack frames for audio API.
15
- * It collapses frames from either the library's directory in development or from `node_modules` when installed.
16
- *
17
- * @param {import('@react-native/metro-config').MetroConfig} config - The original Metro configuration object to be wrapped.
18
- * @returns {import('@react-native/metro-config').MetroConfig} - Modified Metro configuration which customizes stack frame collapsing.
19
- */
20
- function wrapWithAudioAPIMetroConfig(config) {
21
- return {
22
- ...config,
23
- symbolicator: {
24
- async customizeFrame(frame) {
25
- const collapse = Boolean(
26
- // Collapse the stack frame based on user's config symbolicator settings
27
- (await config?.symbolicator?.customizeFrame?.(frame))?.collapse ||
28
- // or, if not already collapsed, collapse the stack frame with path
29
- // to react-native-audio-api source code
30
- (frame.file && COLLAPSED_STACK_REGEX.test(frame.file))
31
- );
32
- return {
33
- collapse,
34
- };
35
- },
36
- },
37
- };
38
- }
39
- module.exports = {
40
- wrapWithAudioAPIMetroConfig,
41
- };
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.json",
3
- }