react-native-audio-api 0.4.13 → 0.4.14
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/CMakeLists.txt +3 -2
- package/android/src/main/cpp/audioapi/android/core/AudioDecoder.cpp +3 -3
- package/android/src/main/cpp/audioapi/android/core/AudioPlayer.cpp +13 -12
- package/android/src/main/cpp/audioapi/android/core/AudioPlayer.h +0 -1
- package/{common/cpp/audioapi/libs/pffft → android/src/main/cpp/audioapi/android/libs}/pffft.c +1 -1
- package/android/src/main/java/com/swmansion/audioapi/AudioAPIPackage.kt +1 -0
- package/common/cpp/audioapi/AudioAPIModuleInstaller.h +3 -1
- package/common/cpp/audioapi/HostObjects/AnalyserNodeHostObject.h +16 -24
- package/common/cpp/audioapi/HostObjects/AudioBufferHostObject.h +0 -4
- package/common/cpp/audioapi/HostObjects/AudioBufferSourceNodeHostObject.h +4 -20
- package/common/cpp/audioapi/HostObjects/AudioContextHostObject.h +2 -3
- package/common/cpp/audioapi/HostObjects/AudioScheduledSourceNodeHostObject.h +2 -32
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +21 -14
- package/common/cpp/audioapi/HostObjects/OscillatorNodeHostObject.h +2 -4
- package/common/cpp/audioapi/HostObjects/StretcherNodeHostObject.h +35 -0
- package/common/cpp/audioapi/core/AudioNode.cpp +2 -2
- package/common/cpp/audioapi/core/AudioParam.cpp +1 -1
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +12 -4
- package/common/cpp/audioapi/core/BaseAudioContext.h +4 -2
- package/common/cpp/audioapi/core/Constants.h +33 -8
- package/common/cpp/audioapi/core/analysis/AnalyserNode.cpp +45 -42
- package/common/cpp/audioapi/core/analysis/AnalyserNode.h +6 -8
- package/common/cpp/audioapi/core/destinations/AudioDestinationNode.cpp +1 -1
- package/common/cpp/audioapi/core/effects/BiquadFilterNode.cpp +8 -12
- package/common/cpp/audioapi/core/effects/GainNode.cpp +3 -4
- package/common/cpp/audioapi/core/effects/PeriodicWave.cpp +49 -32
- package/common/cpp/audioapi/core/effects/PeriodicWave.h +3 -8
- package/common/cpp/audioapi/core/effects/StereoPannerNode.cpp +3 -3
- package/common/cpp/audioapi/core/effects/StretcherNode.cpp +94 -0
- package/common/cpp/audioapi/core/effects/StretcherNode.h +35 -0
- package/common/cpp/audioapi/core/sources/AudioBuffer.cpp +2 -9
- package/common/cpp/audioapi/core/sources/AudioBuffer.h +2 -5
- package/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp +35 -72
- package/common/cpp/audioapi/core/sources/AudioBufferSourceNode.h +8 -41
- package/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.cpp +6 -18
- package/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.h +0 -7
- package/common/cpp/audioapi/core/sources/OscillatorNode.cpp +3 -12
- package/common/cpp/audioapi/core/sources/OscillatorNode.h +0 -1
- package/common/cpp/audioapi/{utils → core/utils}/AudioArray.cpp +5 -5
- package/common/cpp/audioapi/{utils → core/utils}/AudioBus.cpp +29 -29
- package/common/cpp/audioapi/dsp/AudioUtils.cpp +2 -2
- package/common/cpp/audioapi/dsp/AudioUtils.h +2 -2
- package/common/cpp/audioapi/dsp/FFTFrame.cpp +100 -0
- package/common/cpp/audioapi/dsp/FFTFrame.h +74 -0
- package/common/cpp/audioapi/dsp/VectorMath.cpp +3 -3
- package/common/cpp/audioapi/dsp/VectorMath.h +2 -2
- package/common/cpp/audioapi/libs/dsp/common.h +47 -0
- package/common/cpp/audioapi/libs/{signalsmith-stretch → dsp}/delay.h +11 -9
- package/common/cpp/audioapi/libs/{signalsmith-stretch → dsp}/fft.h +7 -6
- package/common/cpp/audioapi/libs/{signalsmith-stretch → dsp}/perf.h +2 -0
- package/common/cpp/audioapi/libs/{signalsmith-stretch → dsp}/spectral.h +13 -10
- package/common/cpp/audioapi/libs/dsp/windows.h +219 -0
- package/common/cpp/audioapi/libs/{signalsmith-stretch/signalsmith-stretch.h → signalsmith-stretch.h} +4 -3
- package/ios/audioapi/ios/core/AudioDecoder.mm +3 -3
- package/ios/audioapi/ios/core/AudioPlayer.h +2 -5
- package/ios/audioapi/ios/core/AudioPlayer.m +5 -9
- package/ios/audioapi/ios/core/IOSAudioPlayer.h +0 -1
- package/ios/audioapi/ios/core/IOSAudioPlayer.mm +10 -12
- package/lib/module/api.js +2 -1
- package/lib/module/api.js.map +1 -1
- package/lib/module/api.web.js +1 -1
- package/lib/module/api.web.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/AudioScheduledSourceNode.js +0 -5
- package/lib/module/core/AudioScheduledSourceNode.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +4 -0
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/StretcherNode.js +12 -0
- package/lib/module/core/StretcherNode.js.map +1 -0
- package/lib/module/web-core/AudioBufferSourceNode.js +0 -6
- package/lib/module/web-core/AudioBufferSourceNode.js.map +1 -1
- package/lib/module/web-core/AudioScheduledSourceNode.js +0 -8
- package/lib/module/web-core/AudioScheduledSourceNode.js.map +1 -1
- package/lib/module/web-core/StretcherNode.js +7 -24
- package/lib/module/web-core/StretcherNode.js.map +1 -1
- package/lib/module/web-core/custom/signalsmithStretch/README.md +1 -1
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.js +0 -1
- package/lib/module/web-core/custom/signalsmithStretch/SignalsmithStretch.js.map +1 -1
- package/lib/typescript/api.d.ts +2 -1
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/api.web.d.ts +1 -1
- package/lib/typescript/api.web.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/AudioScheduledSourceNode.d.ts +0 -1
- package/lib/typescript/core/AudioScheduledSourceNode.d.ts.map +1 -1
- package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/core/StretcherNode.d.ts +10 -0
- package/lib/typescript/core/StretcherNode.d.ts.map +1 -0
- package/lib/typescript/interfaces.d.ts +6 -3
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +0 -1
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioBufferSourceNode.d.ts +0 -3
- package/lib/typescript/web-core/AudioBufferSourceNode.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioScheduledSourceNode.d.ts +0 -1
- package/lib/typescript/web-core/AudioScheduledSourceNode.d.ts.map +1 -1
- package/lib/typescript/web-core/StretcherNode.d.ts +0 -3
- package/lib/typescript/web-core/StretcherNode.d.ts.map +1 -1
- package/package.json +4 -3
- package/scripts/setup-custom-wasm.js +104 -0
- package/src/api.ts +1 -1
- package/src/api.web.ts +0 -1
- package/src/core/AudioBufferSourceNode.ts +0 -9
- package/src/core/AudioScheduledSourceNode.ts +0 -5
- package/src/core/BaseAudioContext.ts +5 -0
- package/src/core/StretcherNode.ts +15 -0
- package/src/interfaces.ts +6 -3
- package/src/types.ts +0 -2
- package/src/web-core/AudioBufferSourceNode.tsx +0 -11
- package/src/web-core/AudioScheduledSourceNode.tsx +0 -9
- package/src/web-core/StretcherNode.tsx +8 -28
- package/src/web-core/custom/signalsmithStretch/README.md +1 -1
- package/src/web-core/custom/signalsmithStretch/SignalsmithStretch.js +0 -1
- package/common/cpp/audioapi/core/types/TimeStretchType.h +0 -7
- package/common/cpp/audioapi/dsp/FFT.cpp +0 -41
- package/common/cpp/audioapi/dsp/FFT.h +0 -29
- package/common/cpp/audioapi/dsp/Windows.cpp +0 -80
- package/common/cpp/audioapi/dsp/Windows.h +0 -95
- package/scripts/setup-rn-audio-api-web.js +0 -58
- /package/{common/cpp/audioapi/libs/pffft → android/src/main/cpp/audioapi/android/libs}/pffft.h +0 -0
- /package/common/cpp/audioapi/{utils → core/utils}/AudioArray.h +0 -0
- /package/common/cpp/audioapi/{utils → core/utils}/AudioBus.h +0 -0
- /package/common/cpp/audioapi/libs/{miniaudio/miniaudio.h → miniaudio.h} +0 -0
|
@@ -14,14 +14,11 @@ typedef void (^RenderAudioBlock)(AudioBufferList *outputBuffer, int numFrames);
|
|
|
14
14
|
@property (nonatomic, strong) AVAudioSourceNode *sourceNode;
|
|
15
15
|
@property (nonatomic, copy) RenderAudioBlock renderAudio;
|
|
16
16
|
@property (nonatomic, assign) float sampleRate;
|
|
17
|
-
@property (nonatomic, assign) int channelCount;
|
|
18
17
|
@property (nonatomic, assign) bool isRunning;
|
|
19
18
|
|
|
20
|
-
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio
|
|
19
|
+
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio;
|
|
21
20
|
|
|
22
|
-
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio
|
|
23
|
-
sampleRate:(float)sampleRate
|
|
24
|
-
channelCount:(int)channelCount;
|
|
21
|
+
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio sampleRate:(float)sampleRate;
|
|
25
22
|
|
|
26
23
|
- (float)getSampleRate;
|
|
27
24
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@implementation AudioPlayer
|
|
4
4
|
|
|
5
|
-
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio
|
|
5
|
+
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio
|
|
6
6
|
{
|
|
7
7
|
if (self = [super init]) {
|
|
8
8
|
self.renderAudio = [renderAudio copy];
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
[self setupAndInitNotificationHandlers];
|
|
15
15
|
|
|
16
16
|
self.sampleRate = [self.audioSession sampleRate];
|
|
17
|
-
self.channelCount = channelCount;
|
|
18
17
|
|
|
19
|
-
_format = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:self.sampleRate channels:
|
|
18
|
+
_format = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:self.sampleRate channels:2];
|
|
20
19
|
|
|
21
20
|
__weak typeof(self) weakSelf = self;
|
|
22
21
|
_sourceNode = [[AVAudioSourceNode alloc] initWithFormat:self.format
|
|
@@ -35,9 +34,7 @@
|
|
|
35
34
|
return self;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio
|
|
39
|
-
sampleRate:(float)sampleRate
|
|
40
|
-
channelCount:(int)channelCount
|
|
37
|
+
- (instancetype)initWithRenderAudioBlock:(RenderAudioBlock)renderAudio sampleRate:(float)sampleRate
|
|
41
38
|
{
|
|
42
39
|
if (self = [super init]) {
|
|
43
40
|
self.renderAudio = [renderAudio copy];
|
|
@@ -49,9 +46,8 @@
|
|
|
49
46
|
[self setupAndInitNotificationHandlers];
|
|
50
47
|
|
|
51
48
|
self.sampleRate = sampleRate;
|
|
52
|
-
self.channelCount = channelCount;
|
|
53
49
|
|
|
54
|
-
_format = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:self.sampleRate channels:
|
|
50
|
+
_format = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:self.sampleRate channels:2];
|
|
55
51
|
|
|
56
52
|
__weak typeof(self) weakSelf = self;
|
|
57
53
|
_sourceNode = [[AVAudioSourceNode alloc] initWithFormat:self.format
|
|
@@ -123,7 +119,7 @@
|
|
|
123
119
|
frameCount:(AVAudioFrameCount)frameCount
|
|
124
120
|
outputData:(AudioBufferList *)outputData
|
|
125
121
|
{
|
|
126
|
-
if (outputData->mNumberBuffers <
|
|
122
|
+
if (outputData->mNumberBuffers < 2) {
|
|
127
123
|
return noErr; // Ensure we have stereo output
|
|
128
124
|
}
|
|
129
125
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#import <AVFoundation/AVFoundation.h>
|
|
2
2
|
|
|
3
3
|
#include <audioapi/core/Constants.h>
|
|
4
|
+
#include <audioapi/core/utils/AudioArray.h>
|
|
5
|
+
#include <audioapi/core/utils/AudioBus.h>
|
|
4
6
|
#include <audioapi/ios/core/IOSAudioPlayer.h>
|
|
5
|
-
#include <audioapi/utils/AudioArray.h>
|
|
6
|
-
#include <audioapi/utils/AudioBus.h>
|
|
7
7
|
|
|
8
8
|
namespace audioapi {
|
|
9
9
|
|
|
10
10
|
IOSAudioPlayer::IOSAudioPlayer(const std::function<void(std::shared_ptr<AudioBus>, int)> &renderAudio)
|
|
11
|
-
:
|
|
11
|
+
: renderAudio_(renderAudio), audioBus_(0)
|
|
12
12
|
{
|
|
13
13
|
RenderAudioBlock renderAudioBlock = ^(AudioBufferList *outputData, int numFrames) {
|
|
14
14
|
int processedFrames = 0;
|
|
@@ -18,7 +18,7 @@ IOSAudioPlayer::IOSAudioPlayer(const std::function<void(std::shared_ptr<AudioBus
|
|
|
18
18
|
renderAudio_(audioBus_, framesToProcess);
|
|
19
19
|
|
|
20
20
|
// TODO: optimize this with SIMD?
|
|
21
|
-
for (int channel = 0; channel <
|
|
21
|
+
for (int channel = 0; channel < CHANNEL_COUNT; channel += 1) {
|
|
22
22
|
float *outputChannel = (float *)outputData->mBuffers[channel].mData;
|
|
23
23
|
auto *inputChannel = audioBus_->getChannel(channel)->getData();
|
|
24
24
|
|
|
@@ -31,12 +31,12 @@ IOSAudioPlayer::IOSAudioPlayer(const std::function<void(std::shared_ptr<AudioBus
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
audioPlayer_ = [[AudioPlayer alloc] initWithRenderAudioBlock:renderAudioBlock
|
|
35
|
-
audioBus_ = std::make_shared<AudioBus>(RENDER_QUANTUM_SIZE,
|
|
34
|
+
audioPlayer_ = [[AudioPlayer alloc] initWithRenderAudioBlock:renderAudioBlock];
|
|
35
|
+
audioBus_ = std::make_shared<AudioBus>(RENDER_QUANTUM_SIZE, CHANNEL_COUNT, getSampleRate());
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
IOSAudioPlayer::IOSAudioPlayer(const std::function<void(std::shared_ptr<AudioBus>, int)> &renderAudio, float sampleRate)
|
|
39
|
-
:
|
|
39
|
+
: renderAudio_(renderAudio), audioBus_(0)
|
|
40
40
|
{
|
|
41
41
|
RenderAudioBlock renderAudioBlock = ^(AudioBufferList *outputData, int numFrames) {
|
|
42
42
|
int processedFrames = 0;
|
|
@@ -46,7 +46,7 @@ IOSAudioPlayer::IOSAudioPlayer(const std::function<void(std::shared_ptr<AudioBus
|
|
|
46
46
|
renderAudio_(audioBus_, framesToProcess);
|
|
47
47
|
|
|
48
48
|
// TODO: optimize this with SIMD?
|
|
49
|
-
for (int channel = 0; channel <
|
|
49
|
+
for (int channel = 0; channel < CHANNEL_COUNT; channel += 1) {
|
|
50
50
|
float *outputChannel = (float *)outputData->mBuffers[channel].mData;
|
|
51
51
|
auto *inputChannel = audioBus_->getChannel(channel)->getData();
|
|
52
52
|
|
|
@@ -59,10 +59,8 @@ IOSAudioPlayer::IOSAudioPlayer(const std::function<void(std::shared_ptr<AudioBus
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
audioPlayer_ = [[AudioPlayer alloc] initWithRenderAudioBlock:renderAudioBlock
|
|
63
|
-
|
|
64
|
-
channelCount:channelCount_];
|
|
65
|
-
audioBus_ = std::make_shared<AudioBus>(RENDER_QUANTUM_SIZE, channelCount_, getSampleRate());
|
|
62
|
+
audioPlayer_ = [[AudioPlayer alloc] initWithRenderAudioBlock:renderAudioBlock sampleRate:sampleRate];
|
|
63
|
+
audioBus_ = std::make_shared<AudioBus>(RENDER_QUANTUM_SIZE, CHANNEL_COUNT, getSampleRate());
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
IOSAudioPlayer::~IOSAudioPlayer()
|
package/lib/module/api.js
CHANGED
|
@@ -25,6 +25,7 @@ export { default as BiquadFilterNode } from "./core/BiquadFilterNode.js";
|
|
|
25
25
|
export { default as GainNode } from "./core/GainNode.js";
|
|
26
26
|
export { default as OscillatorNode } from "./core/OscillatorNode.js";
|
|
27
27
|
export { default as StereoPannerNode } from "./core/StereoPannerNode.js";
|
|
28
|
-
export {
|
|
28
|
+
export { default as StretcherNode } from "./core/StretcherNode.js";
|
|
29
|
+
export { OscillatorType, BiquadFilterType, ChannelCountMode, ChannelInterpretation, ContextState, WindowType, PeriodicWaveConstraints } from "./types.js";
|
|
29
30
|
export { IndexSizeError, InvalidAccessError, InvalidStateError, RangeError, NotSupportedError } from "./errors/index.js";
|
|
30
31
|
//# sourceMappingURL=api.js.map
|
package/lib/module/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeAudioAPIModule","global","createAudioContext","Error","install","default","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioNode","AnalyserNode","AudioParam","AudioScheduledSourceNode","BaseAudioContext","BiquadFilterNode","GainNode","OscillatorNode","StereoPannerNode","OscillatorType","BiquadFilterType","ChannelCountMode","ChannelInterpretation","ContextState","WindowType","PeriodicWaveConstraints","
|
|
1
|
+
{"version":3,"names":["NativeAudioAPIModule","global","createAudioContext","Error","install","default","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioNode","AnalyserNode","AudioParam","AudioScheduledSourceNode","BaseAudioContext","BiquadFilterNode","GainNode","OscillatorNode","StereoPannerNode","StretcherNode","OscillatorType","BiquadFilterType","ChannelCountMode","ChannelInterpretation","ContextState","WindowType","PeriodicWaveConstraints","IndexSizeError","InvalidAccessError","InvalidStateError","RangeError","NotSupportedError"],"sourceRoot":"../../src","sources":["api.ts"],"mappings":";;AAAA,OAAOA,oBAAoB,MAAM,iCAA8B;;AAG/D;;AAIA;;AAEA,IAAIC,MAAM,CAACC,kBAAkB,IAAI,IAAI,EAAE;EACrC,IAAI,CAACF,oBAAoB,EAAE;IACzB,MAAM,IAAIG,KAAK,CACb,iFACF,CAAC;EACH;EAEAH,oBAAoB,CAACI,OAAO,CAAC,CAAC;AAChC;AAEA,SAASC,OAAO,IAAIC,WAAW,QAAQ,uBAAoB;AAC3D,SAASD,OAAO,IAAIE,qBAAqB,QAAQ,iCAA8B;AAC/E,SAASF,OAAO,IAAIG,YAAY,QAAQ,wBAAqB;AAC7D,SAASH,OAAO,IAAII,oBAAoB,QAAQ,gCAA6B;AAC7E,SAASJ,OAAO,IAAIK,SAAS,QAAQ,qBAAkB;AACvD,SAASL,OAAO,IAAIM,YAAY,QAAQ,wBAAqB;AAC7D,SAASN,OAAO,IAAIO,UAAU,QAAQ,sBAAmB;AACzD,SAASP,OAAO,IAAIQ,wBAAwB,QAAQ,oCAAiC;AACrF,SAASR,OAAO,IAAIS,gBAAgB,QAAQ,4BAAyB;AACrE,SAAST,OAAO,IAAIU,gBAAgB,QAAQ,4BAAyB;AACrE,SAASV,OAAO,IAAIW,QAAQ,QAAQ,oBAAiB;AACrD,SAASX,OAAO,IAAIY,cAAc,QAAQ,0BAAuB;AACjE,SAASZ,OAAO,IAAIa,gBAAgB,QAAQ,4BAAyB;AACrE,SAASb,OAAO,IAAIc,aAAa,QAAQ,yBAAsB;AAE/D,SACEC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,UAAU,EACVC,uBAAuB,QAClB,YAAS;AAEhB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,iBAAiB,EACjBC,UAAU,EACVC,iBAAiB,QACZ,mBAAU","ignoreList":[]}
|
package/lib/module/api.web.js
CHANGED
|
@@ -15,6 +15,6 @@ export { default as OscillatorNode } from "./web-core/OscillatorNode.js";
|
|
|
15
15
|
export { default as StereoPannerNode } from "./web-core/StereoPannerNode.js";
|
|
16
16
|
export { default as StretcherNode } from "./web-core/StretcherNode.js";
|
|
17
17
|
export * from "./web-core/custom/index.js";
|
|
18
|
-
export { OscillatorType, BiquadFilterType, ChannelCountMode, ChannelInterpretation, ContextState, WindowType, PeriodicWaveConstraints
|
|
18
|
+
export { OscillatorType, BiquadFilterType, ChannelCountMode, ChannelInterpretation, ContextState, WindowType, PeriodicWaveConstraints } from "./types.js";
|
|
19
19
|
export { IndexSizeError, InvalidAccessError, InvalidStateError, RangeError, NotSupportedError } from "./errors/index.js";
|
|
20
20
|
//# sourceMappingURL=api.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioNode","AnalyserNode","AudioParam","AudioScheduledSourceNode","BaseAudioContext","BiquadFilterNode","GainNode","OscillatorNode","StereoPannerNode","StretcherNode","OscillatorType","BiquadFilterType","ChannelCountMode","ChannelInterpretation","ContextState","WindowType","PeriodicWaveConstraints","
|
|
1
|
+
{"version":3,"names":["default","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioNode","AnalyserNode","AudioParam","AudioScheduledSourceNode","BaseAudioContext","BiquadFilterNode","GainNode","OscillatorNode","StereoPannerNode","StretcherNode","OscillatorType","BiquadFilterType","ChannelCountMode","ChannelInterpretation","ContextState","WindowType","PeriodicWaveConstraints","IndexSizeError","InvalidAccessError","InvalidStateError","RangeError","NotSupportedError"],"sourceRoot":"../../src","sources":["api.web.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,WAAW,QAAQ,2BAAwB;AAC/D,SAASD,OAAO,IAAIE,qBAAqB,QAAQ,qCAAkC;AACnF,SAASF,OAAO,IAAIG,YAAY,QAAQ,4BAAyB;AACjE,SAASH,OAAO,IAAII,oBAAoB,QAAQ,oCAAiC;AACjF,SAASJ,OAAO,IAAIK,SAAS,QAAQ,yBAAsB;AAC3D,SAASL,OAAO,IAAIM,YAAY,QAAQ,4BAAyB;AACjE,SAASN,OAAO,IAAIO,UAAU,QAAQ,0BAAuB;AAC7D,SAASP,OAAO,IAAIQ,wBAAwB,QAAQ,wCAAqC;AACzF,SAASR,OAAO,IAAIS,gBAAgB,QAAQ,gCAA6B;AACzE,SAAST,OAAO,IAAIU,gBAAgB,QAAQ,gCAA6B;AACzE,SAASV,OAAO,IAAIW,QAAQ,QAAQ,wBAAqB;AACzD,SAASX,OAAO,IAAIY,cAAc,QAAQ,8BAA2B;AACrE,SAASZ,OAAO,IAAIa,gBAAgB,QAAQ,gCAA6B;AACzE,SAASb,OAAO,IAAIc,aAAa,QAAQ,6BAA0B;AAEnE,cAAc,4BAAmB;AAEjC,SACEC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,EACZC,UAAU,EACVC,uBAAuB,QAClB,YAAS;AAEhB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,iBAAiB,EACjBC,UAAU,EACVC,iBAAiB,QACZ,mBAAU","ignoreList":[]}
|
|
@@ -42,12 +42,6 @@ export default class AudioBufferSourceNode extends AudioScheduledSourceNode {
|
|
|
42
42
|
set loopEnd(value) {
|
|
43
43
|
this.node.loopEnd = value;
|
|
44
44
|
}
|
|
45
|
-
get timeStretch() {
|
|
46
|
-
return this.node.timeStretch;
|
|
47
|
-
}
|
|
48
|
-
set timeStretch(value) {
|
|
49
|
-
this.node.timeStretch = value;
|
|
50
|
-
}
|
|
51
45
|
start(when = 0, offset = 0, duration) {
|
|
52
46
|
if (when < 0) {
|
|
53
47
|
throw new RangeError(`when must be a finite non-negative number: ${when}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AudioScheduledSourceNode","AudioBuffer","AudioParam","InvalidStateError","RangeError","AudioBufferSourceNode","constructor","context","node","detune","playbackRate","buffer","loop","value","loopStart","loopEnd","
|
|
1
|
+
{"version":3,"names":["AudioScheduledSourceNode","AudioBuffer","AudioParam","InvalidStateError","RangeError","AudioBufferSourceNode","constructor","context","node","detune","playbackRate","buffer","loop","value","loopStart","loopEnd","start","when","offset","duration","hasBeenStarted"],"sourceRoot":"../../../src","sources":["core/AudioBufferSourceNode.ts"],"mappings":";;AACA,OAAOA,wBAAwB,MA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CAACP,IAAI,CAA4BO,OAAO;EACtD;EAEA,IAAWA,OAAOA,CAACF,KAAa,EAAE;IAC/B,IAAI,CAACL,IAAI,CAA4BO,OAAO,GAAGF,KAAK;EACvD;EAEOG,KAAKA,CAACC,IAAY,GAAG,CAAC,EAAEC,MAAc,GAAG,CAAC,EAAEC,QAAiB,EAAQ;IAC1E,IAAIF,IAAI,GAAG,CAAC,EAAE;MACZ,MAAM,IAAIb,UAAU,CAClB,8CAA8Ca,IAAI,EACpD,CAAC;IACH;IAEA,IAAIC,MAAM,GAAG,CAAC,EAAE;MACd,MAAM,IAAId,UAAU,CAClB,gDAAgDc,MAAM,EACxD,CAAC;IACH;IAEA,IAAIC,QAAQ,IAAIA,QAAQ,GAAG,CAAC,EAAE;MAC5B,MAAM,IAAIf,UAAU,CAClB,kDAAkDe,QAAQ,EAC5D,CAAC;IACH;IAEA,IAAI,IAAI,CAACC,cAAc,EAAE;MACvB,MAAM,IAAIjB,iBAAiB,CAAC,kCAAkC,CAAC;IACjE;IAEA,IAAI,CAACiB,cAAc,GAAG,IAAI;IACzB,IAAI,CAACZ,IAAI,CAA4BQ,KAAK,CAACC,IAAI,EAAEC,MAAM,EAAEC,QAAQ,CAAC;EACrE;AACF","ignoreList":[]}
|
|
@@ -23,10 +23,5 @@ export default class AudioScheduledSourceNode extends AudioNode {
|
|
|
23
23
|
}
|
|
24
24
|
this.node.stop(when);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line accessor-pairs
|
|
28
|
-
set onended(callback) {
|
|
29
|
-
this.node.onended = callback;
|
|
30
|
-
}
|
|
31
26
|
}
|
|
32
27
|
//# sourceMappingURL=AudioScheduledSourceNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AudioNode","InvalidStateError","RangeError","AudioScheduledSourceNode","hasBeenStarted","start","when","node","stop"
|
|
1
|
+
{"version":3,"names":["AudioNode","InvalidStateError","RangeError","AudioScheduledSourceNode","hasBeenStarted","start","when","node","stop"],"sourceRoot":"../../../src","sources":["core/AudioScheduledSourceNode.ts"],"mappings":";;AACA,OAAOA,SAAS,MAAM,gBAAa;AACnC,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,oBAAW;AAEzD,eAAe,MAAMC,wBAAwB,SAASH,SAAS,CAAC;EACpDI,cAAc,GAAY,KAAK;EAElCC,KAAKA,CAACC,IAAY,GAAG,CAAC,EAAQ;IACnC,IAAIA,IAAI,GAAG,CAAC,EAAE;MACZ,MAAM,IAAIJ,UAAU,CAClB,8CAA8CI,IAAI,EACpD,CAAC;IACH;IAEA,IAAI,IAAI,CAACF,cAAc,EAAE;MACvB,MAAM,IAAIH,iBAAiB,CAAC,kCAAkC,CAAC;IACjE;IAEA,IAAI,CAACG,cAAc,GAAG,IAAI;IACzB,IAAI,CAACG,IAAI,CAA+BF,KAAK,CAACC,IAAI,CAAC;EACtD;EAEOE,IAAIA,CAACF,IAAY,GAAG,CAAC,EAAQ;IAClC,IAAIA,IAAI,GAAG,CAAC,EAAE;MACZ,MAAM,IAAIJ,UAAU,CAClB,8CAA8CI,IAAI,EACpD,CAAC;IACH;IAEA,IAAI,CAAC,IAAI,CAACF,cAAc,EAAE;MACxB,MAAM,IAAIH,iBAAiB,CACzB,8CACF,CAAC;IACH;IAEC,IAAI,CAACM,IAAI,CAA+BC,IAAI,CAACF,IAAI,CAAC;EACrD;AACF","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ import AudioBufferSourceNode from "./AudioBufferSourceNode.js";
|
|
|
9
9
|
import AudioBuffer from "./AudioBuffer.js";
|
|
10
10
|
import PeriodicWave from "./PeriodicWave.js";
|
|
11
11
|
import AnalyserNode from "./AnalyserNode.js";
|
|
12
|
+
import StretcherNode from "./StretcherNode.js";
|
|
12
13
|
import { InvalidAccessError, NotSupportedError } from "../errors/index.js";
|
|
13
14
|
export default class BaseAudioContext {
|
|
14
15
|
constructor(context) {
|
|
@@ -59,6 +60,9 @@ export default class BaseAudioContext {
|
|
|
59
60
|
createAnalyser() {
|
|
60
61
|
return new AnalyserNode(this, this.context.createAnalyser());
|
|
61
62
|
}
|
|
63
|
+
createStretcher() {
|
|
64
|
+
return new StretcherNode(this, this.context.createStretcher());
|
|
65
|
+
}
|
|
62
66
|
async decodeAudioDataSource(sourcePath) {
|
|
63
67
|
// Remove the file:// prefix if it exists
|
|
64
68
|
if (sourcePath.startsWith('file://')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AudioDestinationNode","OscillatorNode","GainNode","StereoPannerNode","BiquadFilterNode","AudioBufferSourceNode","AudioBuffer","PeriodicWave","AnalyserNode","InvalidAccessError","NotSupportedError","BaseAudioContext","constructor","context","destination","sampleRate","currentTime","state","createOscillator","createGain","createStereoPanner","createBiquadFilter","createBufferSource","createBuffer","numOfChannels","length","createPeriodicWave","real","imag","constraints","disableNormalization","createAnalyser","decodeAudioDataSource","sourcePath","startsWith","replace"],"sourceRoot":"../../../src","sources":["core/BaseAudioContext.ts"],"mappings":";;AAEA,OAAOA,oBAAoB,MAAM,2BAAwB;AACzD,OAAOC,cAAc,MAAM,qBAAkB;AAC7C,OAAOC,QAAQ,MAAM,eAAY;AACjC,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,OAAOC,qBAAqB,MAAM,4BAAyB;AAC3D,OAAOC,WAAW,MAAM,kBAAe;AACvC,OAAOC,YAAY,MAAM,mBAAgB;AACzC,OAAOC,YAAY,MAAM,mBAAgB;AACzC,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,oBAAW;AAEjE,eAAe,MAAMC,gBAAgB,CAAC;EAKpCC,WAAWA,CAACC,OAA0B,EAAE;IACtC,IAAI,CAACA,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,WAAW,GAAG,
|
|
1
|
+
{"version":3,"names":["AudioDestinationNode","OscillatorNode","GainNode","StereoPannerNode","BiquadFilterNode","AudioBufferSourceNode","AudioBuffer","PeriodicWave","AnalyserNode","StretcherNode","InvalidAccessError","NotSupportedError","BaseAudioContext","constructor","context","destination","sampleRate","currentTime","state","createOscillator","createGain","createStereoPanner","createBiquadFilter","createBufferSource","createBuffer","numOfChannels","length","createPeriodicWave","real","imag","constraints","disableNormalization","createAnalyser","createStretcher","decodeAudioDataSource","sourcePath","startsWith","replace"],"sourceRoot":"../../../src","sources":["core/BaseAudioContext.ts"],"mappings":";;AAEA,OAAOA,oBAAoB,MAAM,2BAAwB;AACzD,OAAOC,cAAc,MAAM,qBAAkB;AAC7C,OAAOC,QAAQ,MAAM,eAAY;AACjC,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,OAAOC,gBAAgB,MAAM,uBAAoB;AACjD,OAAOC,qBAAqB,MAAM,4BAAyB;AAC3D,OAAOC,WAAW,MAAM,kBAAe;AACvC,OAAOC,YAAY,MAAM,mBAAgB;AACzC,OAAOC,YAAY,MAAM,mBAAgB;AACzC,OAAOC,aAAa,MAAM,oBAAiB;AAC3C,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,oBAAW;AAEjE,eAAe,MAAMC,gBAAgB,CAAC;EAKpCC,WAAWA,CAACC,OAA0B,EAAE;IACtC,IAAI,CAACA,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,WAAW,GAAG,IAAIf,oBAAoB,CAAC,IAAI,EAAEc,OAAO,CAACC,WAAW,CAAC;IACtE,IAAI,CAACC,UAAU,GAAGF,OAAO,CAACE,UAAU;EACtC;EAEA,IAAWC,WAAWA,CAAA,EAAW;IAC/B,OAAO,IAAI,CAACH,OAAO,CAACG,WAAW;EACjC;EAEA,IAAWC,KAAKA,CAAA,EAAiB;IAC/B,OAAO,IAAI,CAACJ,OAAO,CAACI,KAAK;EAC3B;EAEAC,gBAAgBA,CAAA,EAAmB;IACjC,OAAO,IAAIlB,cAAc,CAAC,IAAI,EAAE,IAAI,CAACa,OAAO,CAACK,gBAAgB,CAAC,CAAC,CAAC;EAClE;EAEAC,UAAUA,CAAA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AACF,MAAM,oBAAoBG,IAAI,CAACH,MAAM,sBACxE,CAAC;IACH;IAEA,MAAMK,oBAAoB,GAAGD,WAAW,EAAEC,oBAAoB,IAAI,KAAK;IAEvE,OAAO,IAAIxB,YAAY,CACrB,IAAI,CAACO,OAAO,CAACa,kBAAkB,CAACC,IAAI,EAAEC,IAAI,EAAEE,oBAAoB,CAClE,CAAC;EACH;EAEAC,cAAcA,CAAA,EAAiB;IAC7B,OAAO,IAAIxB,YAAY,CAAC,IAAI,EAAE,IAAI,CAACM,OAAO,CAACkB,cAAc,CAAC,CAAC,CAAC;EAC9D;EAEAC,eAAeA,CAAA,EAAkB;IAC/B,OAAO,IAAIxB,aAAa,CAAC,IAAI,EAAE,IAAI,CAACK,OAAO,CAACmB,eAAe,CAAC,CAAC,CAAC;EAChE;EAEA,MAAMC,qBAAqBA,CAACC,UAAkB,EAAwB;IACpE;IACA,IAAIA,UAAU,CAACC,UAAU,CAAC,SAAS,CAAC,EAAE;MACpCD,UAAU,GAAGA,UAAU,CAACE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;IAChD;IAEA,OAAO,IAAI/B,WAAW,CACpB,MAAM,IAAI,CAACQ,OAAO,CAACoB,qBAAqB,CAACC,UAAU,CACrD,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import AudioNode from "./AudioNode.js";
|
|
4
|
+
import AudioParam from "./AudioParam.js";
|
|
5
|
+
export default class StretcherNode extends AudioNode {
|
|
6
|
+
constructor(context, stretcher) {
|
|
7
|
+
super(context, stretcher);
|
|
8
|
+
this.rate = new AudioParam(stretcher.rate);
|
|
9
|
+
this.semitones = new AudioParam(stretcher.semitones);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=StretcherNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AudioNode","AudioParam","StretcherNode","constructor","context","stretcher","rate","semitones"],"sourceRoot":"../../../src","sources":["core/StretcherNode.ts"],"mappings":";;AACA,OAAOA,SAAS,MAAM,gBAAa;AACnC,OAAOC,UAAU,MAAM,iBAAc;AAGrC,eAAe,MAAMC,aAAa,SAASF,SAAS,CAAC;EAInDG,WAAWA,CAACC,OAAyB,EAAEC,SAAyB,EAAE;IAChE,KAAK,CAACD,OAAO,EAAEC,SAAS,CAAC;IACzB,IAAI,CAACC,IAAI,GAAG,IAAIL,UAAU,CAACI,SAAS,CAACC,IAAI,CAAC;IAC1C,IAAI,CAACC,SAAS,GAAG,IAAIN,UAAU,CAACI,SAAS,CAACE,SAAS,CAAC;EACtD;AACF","ignoreList":[]}
|
|
@@ -42,12 +42,6 @@ export default class AudioBufferSourceNode extends AudioScheduledSourceNode {
|
|
|
42
42
|
set loopEnd(value) {
|
|
43
43
|
this.node.loopEnd = value;
|
|
44
44
|
}
|
|
45
|
-
get timeStretch() {
|
|
46
|
-
return 'linear';
|
|
47
|
-
}
|
|
48
|
-
set timeStretch(value) {
|
|
49
|
-
console.log('React Native Audio API: setting timeStretch is not supported on web');
|
|
50
|
-
}
|
|
51
45
|
start(when, offset, duration) {
|
|
52
46
|
if (when && when < 0) {
|
|
53
47
|
throw new RangeError(`when must be a finite non-negative number: ${when}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AudioScheduledSourceNode","AudioParam","AudioBuffer","InvalidStateError","RangeError","AudioBufferSourceNode","constructor","context","node","detune","playbackRate","buffer","loop","value","loopStart","loopEnd","
|
|
1
|
+
{"version":3,"names":["AudioScheduledSourceNode","AudioParam","AudioBuffer","InvalidStateError","RangeError","AudioBufferSourceNode","constructor","context","node","detune","playbackRate","buffer","loop","value","loopStart","loopEnd","start","when","offset","duration","hasBeenStarted"],"sourceRoot":"../../../src","sources":["web-core/AudioBufferSourceNode.tsx"],"mappings":";;AAAA,OAAOA,wBAAwB,MAAM,+BAA4B;AACjE,OAAOC,UAAU,MAAM,iBAA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ACF,KAAa,EAAE;IAC/B,IAAI,CAACL,IAAI,CAAsCO,OAAO,GAAGF,KAAK;EACjE;EAEOG,KAAKA,CAACC,IAAa,EAAEC,MAAe,EAAEC,QAAiB,EAAQ;IACpE,IAAIF,IAAI,IAAIA,IAAI,GAAG,CAAC,EAAE;MACpB,MAAM,IAAIb,UAAU,CAClB,8CAA8Ca,IAAI,EACpD,CAAC;IACH;IAEA,IAAIC,MAAM,IAAIA,MAAM,GAAG,CAAC,EAAE;MACxB,MAAM,IAAId,UAAU,CAClB,gDAAgDc,MAAM,EACxD,CAAC;IACH;IAEA,IAAIC,QAAQ,IAAIA,QAAQ,GAAG,CAAC,EAAE;MAC5B,MAAM,IAAIf,UAAU,CAClB,kDAAkDe,QAAQ,EAC5D,CAAC;IACH;IAEA,IAAI,IAAI,CAACC,cAAc,EAAE;MACvB,MAAM,IAAIjB,iBAAiB,CAAC,kCAAkC,CAAC;IACjE;IAEA,IAAI,CAACiB,cAAc,GAAG,IAAI;IACzB,IAAI,CAACZ,IAAI,CAAsCQ,KAAK,CACnDC,IAAI,EACJC,MAAM,EACNC,QACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -23,13 +23,5 @@ export default class AudioScheduledSourceNode extends AudioNode {
|
|
|
23
23
|
}
|
|
24
24
|
this.node.stop(when);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line accessor-pairs
|
|
28
|
-
set onended(callback) {
|
|
29
|
-
const eventCallback = _event => {
|
|
30
|
-
callback();
|
|
31
|
-
};
|
|
32
|
-
this.node.onended = eventCallback;
|
|
33
|
-
}
|
|
34
26
|
}
|
|
35
27
|
//# sourceMappingURL=AudioScheduledSourceNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AudioNode","RangeError","InvalidStateError","AudioScheduledSourceNode","hasBeenStarted","start","when","node","stop"
|
|
1
|
+
{"version":3,"names":["AudioNode","RangeError","InvalidStateError","AudioScheduledSourceNode","hasBeenStarted","start","when","node","stop"],"sourceRoot":"../../../src","sources":["web-core/AudioScheduledSourceNode.tsx"],"mappings":";;AAAA,OAAOA,SAAS,MAAM,gBAAa;AACnC,SAASC,UAAU,EAAEC,iBAAiB,QAAQ,oBAAW;AAEzD,eAAe,MAAMC,wBAAwB,SAASH,SAAS,CAAC;EACpDI,cAAc,GAAY,KAAK;EAElCC,KAAKA,CAACC,IAAY,GAAG,CAAC,EAAQ;IACnC,IAAIA,IAAI,GAAG,CAAC,EAAE;MACZ,MAAM,IAAIL,UAAU,CAClB,8CAA8CK,IAAI,EACpD,CAAC;IACH;IAEA,IAAI,IAAI,CAACF,cAAc,EAAE;MACvB,MAAM,IAAIF,iBAAiB,CAAC,kCAAkC,CAAC;IACjE;IAEA,IAAI,CAACE,cAAc,GAAG,IAAI;IACzB,IAAI,CAACG,IAAI,CAAyCF,KAAK,CAACC,IAAI,CAAC;EAChE;EAEOE,IAAIA,CAACF,IAAY,GAAG,CAAC,EAAQ;IAClC,IAAIA,IAAI,GAAG,CAAC,EAAE;MACZ,MAAM,IAAIL,UAAU,CAClB,8CAA8CK,IAAI,EACpD,CAAC;IACH;IAEA,IAAI,CAAC,IAAI,CAACF,cAAc,EAAE;MACxB,MAAM,IAAIF,iBAAiB,CACzB,8CACF,CAAC;IACH;IAEC,IAAI,CAACK,IAAI,CAAyCC,IAAI,CAACF,IAAI,CAAC;EAC/D;AACF","ignoreList":[]}
|
|
@@ -7,7 +7,6 @@ export default class StretcherNode extends AudioNode {
|
|
|
7
7
|
_playbackRate = 1;
|
|
8
8
|
_loopStart = -1;
|
|
9
9
|
_loopEnd = -1;
|
|
10
|
-
_loop = false;
|
|
11
10
|
_isPlaying = false;
|
|
12
11
|
constructor(context, node) {
|
|
13
12
|
super(context, node);
|
|
@@ -40,38 +39,22 @@ export default class StretcherNode extends AudioNode {
|
|
|
40
39
|
}
|
|
41
40
|
set loopStart(value) {
|
|
42
41
|
this._loopStart = value;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
}
|
|
42
|
+
this.node.schedule({
|
|
43
|
+
loopStart: value
|
|
44
|
+
});
|
|
48
45
|
}
|
|
49
46
|
get loopEnd() {
|
|
50
47
|
return this._loopEnd;
|
|
51
48
|
}
|
|
52
49
|
set loopEnd(value) {
|
|
53
50
|
this._loopEnd = value;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
get loop() {
|
|
61
|
-
return this._loop;
|
|
62
|
-
}
|
|
63
|
-
set loop(value) {
|
|
64
|
-
this._loop = value;
|
|
51
|
+
this.node.schedule({
|
|
52
|
+
loopEnd: value
|
|
53
|
+
});
|
|
65
54
|
}
|
|
66
55
|
start(when, offset, duration, rate, semitones) {
|
|
67
56
|
this._isPlaying = true;
|
|
68
|
-
|
|
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);
|
|
57
|
+
this.node.start(when, offset, duration, rate, semitones);
|
|
75
58
|
}
|
|
76
59
|
stop(when) {
|
|
77
60
|
this._isPlaying = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AudioNode","globalTag","StretcherNode","_buffer","_playbackRate","_loopStart","_loopEnd","
|
|
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,SAA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,QAAQ,CAAC;MAAEE,SAAS,EAAEH;IAAM,CAAC,CAAC;EACzE;EAEA,IAAWI,OAAOA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACjB,QAAQ;EACtB;EAEA,IAAWiB,OAAOA,CAACJ,KAAa,EAAE;IAChC,IAAI,CAACb,QAAQ,GAAGa,KAAK;IAEpB,IAAI,CAACT,IAAI,CAA+BU,QAAQ,CAAC;MAAEG,OAAO,EAAEJ;IAAM,CAAC,CAAC;EACvE;EAEOK,KAAKA,CACVC,IAAa,EACbC,MAAe,EACfC,QAAiB,EACjBN,IAAa,EACbO,SAAkB,EACZ;IACN,IAAI,CAACrB,UAAU,GAAG,IAAI;IAErB,IAAI,CAACG,IAAI,CAA+Bc,KAAK,CAC5CC,IAAI,EACJC,MAAM,EACNC,QAAQ,EACRN,IAAI,EACJO,SACF,CAAC;EACH;EAEOC,IAAIA,CAACJ,IAAa,EAAQ;IAC/B,IAAI,CAAClB,UAAU,GAAG,KAAK;IACtB,IAAI,CAACG,IAAI,CAA+BmB,IAAI,CAACJ,IAAI,CAAC;EACrD;AACF","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@ The current input time, within the sample buffer. You can change how often this
|
|
|
14
14
|
|
|
15
15
|
### `stretch.schedule({...})`
|
|
16
16
|
|
|
17
|
-
This adds a scheduled change, removing any scheduled changes
|
|
17
|
+
This adds a scheduled change, removing any scheduled changes occuring after this one. The object properties are:
|
|
18
18
|
|
|
19
19
|
- `output` (seconds): audio context time for this change. The node compensates for its own latency, but this means you might want to schedule some things ahead of time, otherwise you'll have a softer transition as it catches up.
|
|
20
20
|
- `active` (bool): processing audio
|