react-native-audio-api 0.4.12 → 0.5.0-rc.1
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/java/com/swmansion/audioapi/AudioAPIModule.kt +7 -6
- package/android/src/main/java/com/swmansion/audioapi/AudioAPIPackage.kt +25 -24
- package/common/cpp/audioapi/HostObjects/AnalyserNodeHostObject.h +17 -41
- package/common/cpp/audioapi/HostObjects/AudioBufferHostObject.h +22 -32
- package/common/cpp/audioapi/HostObjects/AudioBufferSourceNodeHostObject.h +2 -17
- package/common/cpp/audioapi/HostObjects/AudioContextHostObject.h +14 -4
- package/common/cpp/audioapi/HostObjects/AudioParamHostObject.h +5 -8
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +13 -9
- package/common/cpp/audioapi/HostObjects/BiquadFilterNodeHostObject.h +8 -19
- package/common/cpp/audioapi/core/AudioContext.cpp +14 -4
- package/common/cpp/audioapi/core/AudioContext.h +2 -2
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +4 -2
- package/common/cpp/audioapi/core/BaseAudioContext.h +1 -1
- package/common/cpp/audioapi/core/effects/BiquadFilterNode.cpp +5 -6
- package/common/cpp/audioapi/core/effects/BiquadFilterNode.h +4 -3
- package/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp +5 -11
- package/common/cpp/audioapi/core/sources/AudioBufferSourceNode.h +3 -31
- package/lib/module/api.js +1 -1
- package/lib/module/api.js.map +1 -1
- package/lib/module/api.web.js +1 -2
- package/lib/module/api.web.js.map +1 -1
- package/lib/module/core/AnalyserNode.js.map +1 -1
- package/lib/module/core/AudioBuffer.js.map +1 -1
- package/lib/module/core/AudioBufferSourceNode.js +0 -6
- package/lib/module/core/AudioBufferSourceNode.js.map +1 -1
- package/lib/module/core/AudioParam.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +3 -2
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/BiquadFilterNode.js.map +1 -1
- package/lib/module/utils/index.js +6 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/web-core/AnalyserNode.js +4 -20
- package/lib/module/web-core/AnalyserNode.js.map +1 -1
- package/lib/module/web-core/AudioBuffer.js +2 -6
- package/lib/module/web-core/AudioBuffer.js.map +1 -1
- package/lib/module/web-core/AudioBufferSourceNode.js +161 -21
- package/lib/module/web-core/AudioBufferSourceNode.js.map +1 -1
- package/lib/module/web-core/AudioContext.js +7 -8
- package/lib/module/web-core/AudioContext.js.map +1 -1
- package/lib/module/web-core/AudioParam.js +1 -1
- package/lib/module/web-core/AudioParam.js.map +1 -1
- package/lib/module/web-core/BiquadFilterNode.js +1 -9
- package/lib/module/web-core/BiquadFilterNode.js.map +1 -1
- package/lib/module/web-core/custom/signalsmithStretch/README.md +1 -1
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.mjs +2 -2
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.mjs.map +1 -1
- package/lib/typescript/api.d.ts +1 -1
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/api.web.d.ts +1 -2
- package/lib/typescript/api.web.d.ts.map +1 -1
- package/lib/typescript/core/AnalyserNode.d.ts +4 -4
- package/lib/typescript/core/AnalyserNode.d.ts.map +1 -1
- package/lib/typescript/core/AudioBuffer.d.ts +3 -3
- package/lib/typescript/core/AudioBuffer.d.ts.map +1 -1
- package/lib/typescript/core/AudioBufferSourceNode.d.ts +0 -3
- package/lib/typescript/core/AudioBufferSourceNode.d.ts.map +1 -1
- package/lib/typescript/core/AudioParam.d.ts +1 -1
- package/lib/typescript/core/AudioParam.d.ts.map +1 -1
- package/lib/typescript/core/BaseAudioContext.d.ts +3 -3
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/core/BiquadFilterNode.d.ts +1 -1
- package/lib/typescript/core/BiquadFilterNode.d.ts.map +1 -1
- package/lib/typescript/interfaces.d.ts +12 -13
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +3 -1
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +2 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/lib/typescript/web-core/AnalyserNode.d.ts +4 -4
- package/lib/typescript/web-core/AnalyserNode.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioBuffer.d.ts +2 -2
- package/lib/typescript/web-core/AudioBuffer.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioBufferSourceNode.d.ts +58 -6
- package/lib/typescript/web-core/AudioBufferSourceNode.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioContext.d.ts +3 -5
- package/lib/typescript/web-core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioParam.d.ts +1 -1
- package/lib/typescript/web-core/AudioParam.d.ts.map +1 -1
- package/lib/typescript/web-core/BaseAudioContext.d.ts +2 -2
- package/lib/typescript/web-core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/BiquadFilterNode.d.ts +1 -1
- package/lib/typescript/web-core/BiquadFilterNode.d.ts.map +1 -1
- package/package.json +8 -8
- package/scripts/setup-rn-audio-api-web.js +58 -0
- package/src/api.ts +0 -1
- package/src/api.web.ts +0 -2
- package/src/core/AnalyserNode.ts +4 -4
- package/src/core/AudioBuffer.ts +3 -3
- package/src/core/AudioBufferSourceNode.ts +0 -9
- package/src/core/AudioParam.ts +1 -1
- package/src/core/BaseAudioContext.ts +16 -5
- package/src/core/BiquadFilterNode.ts +3 -3
- package/src/interfaces.ts +14 -16
- package/src/types.ts +3 -1
- package/src/utils/index.ts +3 -0
- package/src/web-core/AnalyserNode.tsx +8 -30
- package/src/web-core/AudioBuffer.tsx +4 -14
- package/src/web-core/AudioBufferSourceNode.tsx +357 -31
- package/src/web-core/AudioContext.tsx +19 -13
- package/src/web-core/AudioParam.tsx +2 -6
- package/src/web-core/BaseAudioContext.tsx +3 -3
- package/src/web-core/BiquadFilterNode.tsx +6 -16
- package/src/web-core/custom/signalsmithStretch/README.md +1 -1
- package/src/web-core/custom/signalsmithStretch/SignalsmithStretch.mjs +4 -3
- package/common/cpp/audioapi/core/types/TimeStretchType.h +0 -7
- package/lib/module/web-core/StretcherNode.js +0 -64
- package/lib/module/web-core/StretcherNode.js.map +0 -1
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.js +0 -822
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.js.map +0 -1
- package/lib/typescript/web-core/StretcherNode.d.ts +0 -45
- package/lib/typescript/web-core/StretcherNode.d.ts.map +0 -1
- package/scripts/setup-custom-wasm.js +0 -104
- package/src/web-core/StretcherNode.tsx +0 -125
- package/src/web-core/custom/signalsmithStretch/SignalsmithStretch.js +0 -945
|
@@ -510,8 +510,7 @@ function registerWorkletProcessor(Module, audioNodeKey) {
|
|
|
510
510
|
return result;
|
|
511
511
|
},
|
|
512
512
|
schedule: (objIn, adjustPrevious) => {
|
|
513
|
-
let outputTime =
|
|
514
|
-
'outputTime' in objIn ? objIn.outputTime : currentTime;
|
|
513
|
+
let outputTime = 'output' in objIn ? objIn.output : currentTime;
|
|
515
514
|
|
|
516
515
|
let latestSegment = this.timeMap[this.timeMap.length - 1];
|
|
517
516
|
while (
|
|
@@ -524,13 +523,15 @@ function registerWorkletProcessor(Module, audioNodeKey) {
|
|
|
524
523
|
let obj = {
|
|
525
524
|
active: latestSegment.active,
|
|
526
525
|
input: null,
|
|
527
|
-
output: outputTime,
|
|
528
526
|
rate: latestSegment.rate,
|
|
529
527
|
semitones: latestSegment.semitones,
|
|
530
528
|
loopStart: latestSegment.loopStart,
|
|
531
529
|
loopEnd: latestSegment.loopEnd,
|
|
532
530
|
};
|
|
531
|
+
|
|
533
532
|
Object.assign(obj, objIn);
|
|
533
|
+
obj.output = outputTime;
|
|
534
|
+
|
|
534
535
|
if (obj.input === null) {
|
|
535
536
|
let rate = latestSegment.active ? latestSegment.rate : 0;
|
|
536
537
|
obj.input =
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import AudioNode from "./AudioNode.js";
|
|
4
|
-
import { globalTag } from "./custom/LoadCustomWasm.js";
|
|
5
|
-
export default class StretcherNode extends AudioNode {
|
|
6
|
-
_buffer = null;
|
|
7
|
-
_playbackRate = 1;
|
|
8
|
-
_loopStart = -1;
|
|
9
|
-
_loopEnd = -1;
|
|
10
|
-
_isPlaying = false;
|
|
11
|
-
constructor(context, node) {
|
|
12
|
-
super(context, node);
|
|
13
|
-
this._buffer = null;
|
|
14
|
-
}
|
|
15
|
-
get buffer() {
|
|
16
|
-
return this._buffer;
|
|
17
|
-
}
|
|
18
|
-
set buffer(buffer) {
|
|
19
|
-
this._buffer = buffer;
|
|
20
|
-
const channelArrays = [];
|
|
21
|
-
for (let i = 0; i < buffer.numberOfChannels; i += 1) {
|
|
22
|
-
channelArrays.push(buffer.getChannelData(i));
|
|
23
|
-
}
|
|
24
|
-
this.node.addBuffers(channelArrays);
|
|
25
|
-
}
|
|
26
|
-
get playbackRate() {
|
|
27
|
-
return this._playbackRate;
|
|
28
|
-
}
|
|
29
|
-
set playbackRate(value) {
|
|
30
|
-
this._playbackRate = value;
|
|
31
|
-
if (this._isPlaying) {
|
|
32
|
-
this.node.schedule({
|
|
33
|
-
rate: value
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
get loopStart() {
|
|
38
|
-
return this._loopStart;
|
|
39
|
-
}
|
|
40
|
-
set loopStart(value) {
|
|
41
|
-
this._loopStart = value;
|
|
42
|
-
this.node.schedule({
|
|
43
|
-
loopStart: value
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
get loopEnd() {
|
|
47
|
-
return this._loopEnd;
|
|
48
|
-
}
|
|
49
|
-
set loopEnd(value) {
|
|
50
|
-
this._loopEnd = value;
|
|
51
|
-
this.node.schedule({
|
|
52
|
-
loopEnd: value
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
start(when, offset, duration, rate, semitones) {
|
|
56
|
-
this._isPlaying = true;
|
|
57
|
-
this.node.start(when, offset, duration, rate, semitones);
|
|
58
|
-
}
|
|
59
|
-
stop(when) {
|
|
60
|
-
this._isPlaying = false;
|
|
61
|
-
this.node.stop(when);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=StretcherNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AudioNode","globalTag","StretcherNode","_buffer","_playbackRate","_loopStart","_loopEnd","_isPlaying","constructor","context","node","buffer","channelArrays","i","numberOfChannels","push","getChannelData","addBuffers","playbackRate","value","schedule","rate","loopStart","loopEnd","start","when","offset","duration","semitones","stop"],"sourceRoot":"../../../src","sources":["web-core/StretcherNode.tsx"],"mappings":";;AAEA,OAAOA,SAAS,MAAM,gBAAa;AAEnC,SAASC,SAAS,QAAQ,4BAAyB;AAsCnD,eAAe,MAAMC,aAAa,SAASF,SAAS,CAAC;EACnDG,OAAO,GAAuB,IAAI;EAElCC,aAAa,GAAW,CAAC;EACzBC,UAAU,GAAW,CAAC,CAAC;EACvBC,QAAQ,GAAW,CAAC,CAAC;EACrBC,UAAU,GAAG,KAAK;EAElBC,WAAWA,CAACC,OAAyB,EAAEC,IAAoB,EAAE;IAC3D,KAAK,CAACD,OAAO,EAAEC,IAAuC,CAAC;IACvD,IAAI,CAACP,OAAO,GAAG,IAAI;EACrB;EAEA,IAAWQ,MAAMA,CAAA,EAAuB;IACtC,OAAO,IAAI,CAACR,OAAO;EACrB;EAEA,IAAWQ,MAAMA,CAACA,MAAmB,EAAE;IACrC,IAAI,CAACR,OAAO,GAAGQ,MAAM;IACrB,MAAMC,aAAa,GAAG,EAAE;IAExB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,gBAAgB,EAAED,CAAC,IAAI,CAAC,EAAE;MACnDD,aAAa,CAACG,IAAI,CAACJ,MAAM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