react-native-audio-api 0.10.0-nightly-034f768-20251019 → 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.
- package/android/build.gradle +1 -0
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.cpp +12 -5
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +12 -6
- package/common/cpp/audioapi/core/BaseAudioContext.h +14 -3
- package/common/cpp/audioapi/core/effects/WorkletNode.cpp +31 -32
- package/common/cpp/audioapi/core/effects/WorkletNode.h +4 -7
- package/common/cpp/audioapi/core/effects/WorkletProcessingNode.cpp +12 -13
- package/common/cpp/audioapi/core/effects/WorkletProcessingNode.h +2 -5
- package/common/cpp/audioapi/core/sources/WorkletSourceNode.cpp +12 -13
- package/common/cpp/audioapi/core/sources/WorkletSourceNode.h +2 -5
- package/common/cpp/audioapi/core/utils/worklets/SafeIncludes.h +32 -3
- package/common/cpp/audioapi/core/utils/worklets/WorkletsRunner.cpp +75 -2
- package/common/cpp/audioapi/core/utils/worklets/WorkletsRunner.h +50 -36
- package/ios/audioapi/ios/core/IOSAudioRecorder.h +2 -1
- package/lib/commonjs/api.js +43 -0
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/api.web.js +50 -0
- package/lib/commonjs/api.web.js.map +1 -1
- package/lib/commonjs/core/AudioContext.js +0 -4
- package/lib/commonjs/core/AudioContext.js.map +1 -1
- package/lib/commonjs/core/OfflineAudioContext.js +0 -4
- package/lib/commonjs/core/OfflineAudioContext.js.map +1 -1
- package/lib/commonjs/utils/index.js +1 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/web-core/AudioScheduledSourceNode.js.map +1 -1
- package/lib/module/api.js +1 -0
- package/lib/module/api.js.map +1 -1
- package/lib/module/api.web.js +1 -0
- package/lib/module/api.web.js.map +1 -1
- package/lib/module/core/AudioContext.js +0 -4
- package/lib/module/core/AudioContext.js.map +1 -1
- package/lib/module/core/OfflineAudioContext.js +0 -4
- package/lib/module/core/OfflineAudioContext.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/web-core/AudioScheduledSourceNode.js.map +1 -1
- package/lib/typescript/api.d.ts +1 -0
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/api.web.d.ts +1 -0
- package/lib/typescript/api.web.d.ts.map +1 -1
- package/lib/typescript/core/AudioContext.d.ts +0 -1
- package/lib/typescript/core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/core/OfflineAudioContext.d.ts +0 -1
- package/lib/typescript/core/OfflineAudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioBufferSourceNode.d.ts +2 -2
- package/lib/typescript/web-core/AudioBufferSourceNode.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioScheduledSourceNode.d.ts +1 -1
- package/lib/typescript/web-core/AudioScheduledSourceNode.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/api.ts +10 -0
- package/src/api.web.ts +10 -0
- package/src/core/AudioContext.ts +0 -5
- package/src/core/OfflineAudioContext.ts +0 -5
- package/src/utils/index.ts +1 -0
- package/src/web-core/AudioBufferSourceNode.tsx +2 -2
- 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,
|
package/src/core/AudioContext.ts
CHANGED
|
@@ -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> {
|
package/src/utils/index.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
}
|