react-native-audio-api 0.4.13 → 0.5.0
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/core/AudioDecoder.cpp +87 -5
- 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 +25 -34
- 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 +38 -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 +16 -2
- package/common/cpp/audioapi/core/BaseAudioContext.h +2 -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/common/cpp/audioapi/core/utils/AudioDecoder.h +2 -1
- package/common/cpp/audioapi/jsi/AudioArrayBuffer.cpp +13 -0
- package/common/cpp/audioapi/jsi/AudioArrayBuffer.h +23 -0
- package/ios/audioapi/ios/core/AudioDecoder.mm +45 -1
- 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 +6 -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 +10 -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/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 +4 -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 +13 -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 +4 -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 +3 -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 +6 -6
- 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 +22 -5
- package/src/core/BiquadFilterNode.ts +3 -3
- package/src/interfaces.ts +15 -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 +23 -13
- package/src/web-core/AudioParam.tsx +2 -6
- package/src/web-core/BaseAudioContext.tsx +4 -3
- package/src/web-core/BiquadFilterNode.tsx +6 -16
- 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 -81
- package/lib/module/web-core/StretcherNode.js.map +0 -1
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.js +0 -823
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.js.map +0 -1
- package/lib/typescript/web-core/StretcherNode.d.ts +0 -48
- package/lib/typescript/web-core/StretcherNode.d.ts.map +0 -1
- package/src/web-core/StretcherNode.tsx +0 -145
- package/src/web-core/custom/signalsmithStretch/SignalsmithStretch.js +0 -946
|
@@ -1,81 +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
|
-
_loop = false;
|
|
11
|
-
_isPlaying = false;
|
|
12
|
-
constructor(context, node) {
|
|
13
|
-
super(context, node);
|
|
14
|
-
this._buffer = null;
|
|
15
|
-
}
|
|
16
|
-
get buffer() {
|
|
17
|
-
return this._buffer;
|
|
18
|
-
}
|
|
19
|
-
set buffer(buffer) {
|
|
20
|
-
this._buffer = buffer;
|
|
21
|
-
const channelArrays = [];
|
|
22
|
-
for (let i = 0; i < buffer.numberOfChannels; i += 1) {
|
|
23
|
-
channelArrays.push(buffer.getChannelData(i));
|
|
24
|
-
}
|
|
25
|
-
this.node.addBuffers(channelArrays);
|
|
26
|
-
}
|
|
27
|
-
get playbackRate() {
|
|
28
|
-
return this._playbackRate;
|
|
29
|
-
}
|
|
30
|
-
set playbackRate(value) {
|
|
31
|
-
this._playbackRate = value;
|
|
32
|
-
if (this._isPlaying) {
|
|
33
|
-
this.node.schedule({
|
|
34
|
-
rate: value
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
get loopStart() {
|
|
39
|
-
return this._loopStart;
|
|
40
|
-
}
|
|
41
|
-
set loopStart(value) {
|
|
42
|
-
this._loopStart = value;
|
|
43
|
-
if (this._isPlaying) {
|
|
44
|
-
this.node.schedule({
|
|
45
|
-
loopStart: value
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
get loopEnd() {
|
|
50
|
-
return this._loopEnd;
|
|
51
|
-
}
|
|
52
|
-
set loopEnd(value) {
|
|
53
|
-
this._loopEnd = value;
|
|
54
|
-
if (this._isPlaying) {
|
|
55
|
-
this.node.schedule({
|
|
56
|
-
loopEnd: value
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
get loop() {
|
|
61
|
-
return this._loop;
|
|
62
|
-
}
|
|
63
|
-
set loop(value) {
|
|
64
|
-
this._loop = value;
|
|
65
|
-
}
|
|
66
|
-
start(when, offset, duration, rate, semitones) {
|
|
67
|
-
this._isPlaying = true;
|
|
68
|
-
if (this.loop && this._loopStart !== -1 && this._loopEnd !== -1) {
|
|
69
|
-
this.node.schedule({
|
|
70
|
-
loopStart: this._loopStart,
|
|
71
|
-
loopEnd: this._loopEnd
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
this.node.start(when ?? 0, offset ?? 0, duration ?? this._buffer?.duration ?? 0, rate ?? this._playbackRate ?? 0, semitones ?? 0);
|
|
75
|
-
}
|
|
76
|
-
stop(when) {
|
|
77
|
-
this._isPlaying = false;
|
|
78
|
-
this.node.stop(when);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=StretcherNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AudioNode","globalTag","StretcherNode","_buffer","_playbackRate","_loopStart","_loopEnd","_loop","_isPlaying","constructor","context","node","buffer","channelArrays","i","numberOfChannels","push","getChannelData","addBuffers","playbackRate","value","schedule","rate","loopStart","loopEnd","loop","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,KAAK,GAAG,KAAK;EACbC,UAAU,GAAG,KAAK;EAElBC,WAAWA,CAACC,OAAyB,EAAEC,IAAoB,EAAE;IAC3D,KAAK,CAACD,OAAO,EAAEC,IAAuC,CAAC;IACvD,IAAI,CAACR,OAAO,GAAG,IAAI;EACrB;EAEA,IAAWS,MAAMA,CAAA,EAAuB;IACtC,OAAO,IAAI,CAACT,OAAO;EACrB;EAEA,IAAWS,MAAMA,CAACA,MAAmB,EAAE;IACrC,IAAI,CAACT,OAAO,GAAGS,MAAM;IACrB,MAAMC,aAA6B,GAAG,EAAE;IAExC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,gBAAgB,EAAED,CAAC,IAAI,CAAC,EAAE;MACnDD,aAAa,CAACG,IAAI,CAACJ,MAAM,CAACK,cAAc,CAACH,CAAC,CAAC,CAAC;IAC9C;IAEC,IAAI,CAACH,IAAI,CAA+BO,UAAU,CAACL,aAAa,CAAC;EACpE;EAEA,IAAWM,YAAYA,CAAA,EAAW;IAChC,OAAO,IAAI,CAACf,aAAa;EAC3B;EAEA,IAAWe,YAAYA,CAACC,KAAa,EAAE;IACrC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