react-native-audio-api 0.10.0-nightly-034f768-20251020 → 0.10.0-nightly-2d11b56-20251021

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 (56) hide show
  1. package/android/build.gradle +1 -0
  2. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.cpp +12 -5
  3. package/common/cpp/audioapi/core/BaseAudioContext.cpp +12 -6
  4. package/common/cpp/audioapi/core/BaseAudioContext.h +14 -3
  5. package/common/cpp/audioapi/core/effects/WorkletNode.cpp +31 -32
  6. package/common/cpp/audioapi/core/effects/WorkletNode.h +4 -7
  7. package/common/cpp/audioapi/core/effects/WorkletProcessingNode.cpp +12 -13
  8. package/common/cpp/audioapi/core/effects/WorkletProcessingNode.h +2 -5
  9. package/common/cpp/audioapi/core/sources/WorkletSourceNode.cpp +12 -13
  10. package/common/cpp/audioapi/core/sources/WorkletSourceNode.h +2 -5
  11. package/common/cpp/audioapi/core/utils/worklets/SafeIncludes.h +32 -3
  12. package/common/cpp/audioapi/core/utils/worklets/WorkletsRunner.cpp +75 -2
  13. package/common/cpp/audioapi/core/utils/worklets/WorkletsRunner.h +50 -36
  14. package/ios/audioapi/ios/core/IOSAudioRecorder.h +2 -1
  15. package/lib/commonjs/api.js +43 -0
  16. package/lib/commonjs/api.js.map +1 -1
  17. package/lib/commonjs/api.web.js +50 -0
  18. package/lib/commonjs/api.web.js.map +1 -1
  19. package/lib/commonjs/core/AudioContext.js +0 -4
  20. package/lib/commonjs/core/AudioContext.js.map +1 -1
  21. package/lib/commonjs/core/OfflineAudioContext.js +0 -4
  22. package/lib/commonjs/core/OfflineAudioContext.js.map +1 -1
  23. package/lib/commonjs/utils/index.js +1 -0
  24. package/lib/commonjs/utils/index.js.map +1 -1
  25. package/lib/commonjs/web-core/AudioScheduledSourceNode.js.map +1 -1
  26. package/lib/module/api.js +1 -0
  27. package/lib/module/api.js.map +1 -1
  28. package/lib/module/api.web.js +1 -0
  29. package/lib/module/api.web.js.map +1 -1
  30. package/lib/module/core/AudioContext.js +0 -4
  31. package/lib/module/core/AudioContext.js.map +1 -1
  32. package/lib/module/core/OfflineAudioContext.js +0 -4
  33. package/lib/module/core/OfflineAudioContext.js.map +1 -1
  34. package/lib/module/utils/index.js +1 -0
  35. package/lib/module/utils/index.js.map +1 -1
  36. package/lib/module/web-core/AudioScheduledSourceNode.js.map +1 -1
  37. package/lib/typescript/api.d.ts +1 -0
  38. package/lib/typescript/api.d.ts.map +1 -1
  39. package/lib/typescript/api.web.d.ts +1 -0
  40. package/lib/typescript/api.web.d.ts.map +1 -1
  41. package/lib/typescript/core/AudioContext.d.ts +0 -1
  42. package/lib/typescript/core/AudioContext.d.ts.map +1 -1
  43. package/lib/typescript/core/OfflineAudioContext.d.ts +0 -1
  44. package/lib/typescript/core/OfflineAudioContext.d.ts.map +1 -1
  45. package/lib/typescript/web-core/AudioBufferSourceNode.d.ts +2 -2
  46. package/lib/typescript/web-core/AudioBufferSourceNode.d.ts.map +1 -1
  47. package/lib/typescript/web-core/AudioScheduledSourceNode.d.ts +1 -1
  48. package/lib/typescript/web-core/AudioScheduledSourceNode.d.ts.map +1 -1
  49. package/package.json +8 -8
  50. package/src/api.ts +10 -0
  51. package/src/api.web.ts +10 -0
  52. package/src/core/AudioContext.ts +0 -5
  53. package/src/core/OfflineAudioContext.ts +0 -5
  54. package/src/utils/index.ts +1 -0
  55. package/src/web-core/AudioBufferSourceNode.tsx +2 -2
  56. package/src/web-core/AudioScheduledSourceNode.tsx +1 -1
package/src/api.web.ts CHANGED
@@ -26,6 +26,16 @@ export {
26
26
  PeriodicWaveConstraints,
27
27
  } from './types';
28
28
 
29
+ export {
30
+ IOSCategory,
31
+ IOSMode,
32
+ IOSOption,
33
+ SessionOptions,
34
+ MediaState,
35
+ LockScreenInfo,
36
+ PermissionStatus,
37
+ } from './system/types';
38
+
29
39
  export {
30
40
  IndexSizeError,
31
41
  InvalidAccessError,
@@ -6,10 +6,6 @@ import { NotSupportedError } from '../errors';
6
6
  import { isWorkletsAvailable, workletsModule } from '../utils';
7
7
 
8
8
  export default class AudioContext extends BaseAudioContext {
9
- // We need to keep here a reference to this runtime to better manage its lifecycle
10
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
11
- private _audioRuntime: any = null;
12
-
13
9
  constructor(options?: AudioContextOptions) {
14
10
  if (
15
11
  options &&
@@ -32,7 +28,6 @@ export default class AudioContext extends BaseAudioContext {
32
28
  audioRuntime
33
29
  )
34
30
  );
35
- this._audioRuntime = audioRuntime;
36
31
  }
37
32
 
38
33
  async close(): Promise<void> {
@@ -10,10 +10,6 @@ export default class OfflineAudioContext extends BaseAudioContext {
10
10
  private isRendering: boolean;
11
11
  private duration: number;
12
12
 
13
- // We need to keep here a reference to this runtime to better manage its lifecycle
14
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
15
- private _audioRuntime: any;
16
-
17
13
  constructor(options: OfflineAudioContextOptions);
18
14
  constructor(numberOfChannels: number, length: number, sampleRate: number);
19
15
  constructor(
@@ -51,7 +47,6 @@ export default class OfflineAudioContext extends BaseAudioContext {
51
47
 
52
48
  this.isSuspended = false;
53
49
  this.isRendering = false;
54
- this._audioRuntime = audioRuntime;
55
50
  }
56
51
 
57
52
  async resume(): Promise<undefined> {
@@ -19,6 +19,7 @@ export let workletsModule: SimplifiedWorkletModule;
19
19
  try {
20
20
  workletsModule = require('react-native-worklets');
21
21
  isWorkletsAvailable = true;
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
23
  } catch (error) {
23
24
  isWorkletsAvailable = false;
24
25
  }
@@ -32,13 +32,13 @@ interface IStretcherNode extends globalThis.AudioNode {
32
32
  addEventListener: (
33
33
  type: string,
34
34
  listener: EventListenerOrEventListenerObject | null,
35
- options?: boolean | AddEventListenerOptions | undefined
35
+ options?: boolean | AddEventListenerOptions
36
36
  ) => void;
37
37
  dispatchEvent: (event: Event) => boolean;
38
38
  removeEventListener: (
39
39
  type: string,
40
40
  callback: EventListenerOrEventListenerObject | null,
41
- options?: boolean | EventListenerOptions | undefined
41
+ options?: boolean | EventListenerOptions
42
42
  ) => void;
43
43
 
44
44
  addBuffers(channels: Float32Array[]): void;
@@ -37,7 +37,7 @@ export default class AudioScheduledSourceNode extends AudioNode {
37
37
  }
38
38
 
39
39
  // eslint-disable-next-line accessor-pairs
40
- public set onEnded(callback: (event: EventEmptyType) => void) {
40
+ public set onEnded(callback: (event: EventEmptyType) => void | null) {
41
41
  (this.node as globalThis.AudioScheduledSourceNode).onended = callback;
42
42
  }
43
43
  }