react-native-audio-api 0.10.0-nightly-dedc2a2-20251029 → 0.10.0-nightly-e16d7ff-20251030
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/RNAudioAPI.podspec +7 -0
- package/android/src/main/cpp/audioapi/CMakeLists.txt +6 -0
- package/android/src/main/java/com/swmansion/audioapi/system/MediaNotificationManager.kt +11 -0
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.cpp +18 -0
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +1 -0
- package/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.cpp +47 -0
- package/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.h +20 -0
- package/common/cpp/audioapi/core/AudioNode.h +3 -2
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +10 -0
- package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
- package/common/cpp/audioapi/core/effects/ConvolverNode.cpp +210 -0
- package/common/cpp/audioapi/core/effects/ConvolverNode.h +55 -0
- package/common/cpp/audioapi/core/sources/StreamerNode.cpp +59 -58
- package/common/cpp/audioapi/core/sources/StreamerNode.h +37 -8
- package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +5 -0
- package/common/cpp/audioapi/dsp/AudioUtils.cpp +1 -1
- package/common/cpp/audioapi/dsp/Convolver.cpp +213 -0
- package/common/cpp/audioapi/dsp/Convolver.h +45 -0
- package/common/cpp/audioapi/dsp/FFT.cpp +0 -26
- package/common/cpp/audioapi/dsp/FFT.h +26 -2
- package/common/cpp/audioapi/utils/AlignedAllocator.hpp +50 -0
- package/common/cpp/audioapi/utils/AudioBus.cpp +28 -0
- package/common/cpp/audioapi/utils/AudioBus.h +3 -0
- package/common/cpp/test/CMakeLists.txt +16 -14
- package/lib/commonjs/api.js +7 -0
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/api.web.js +8 -0
- package/lib/commonjs/api.web.js.map +1 -1
- package/lib/commonjs/core/BaseAudioContext.js +12 -0
- package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
- package/lib/commonjs/core/ConvolverNode.js +37 -0
- package/lib/commonjs/core/ConvolverNode.js.map +1 -0
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/web-core/AudioContext.js +12 -0
- package/lib/commonjs/web-core/AudioContext.js.map +1 -1
- package/lib/commonjs/web-core/ConvolverNode.js +40 -0
- package/lib/commonjs/web-core/ConvolverNode.js.map +1 -0
- package/lib/commonjs/web-core/ConvolverNodeOptions.js +6 -0
- package/lib/commonjs/web-core/ConvolverNodeOptions.js.map +1 -0
- package/lib/commonjs/web-core/OfflineAudioContext.js +12 -0
- package/lib/commonjs/web-core/OfflineAudioContext.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/BaseAudioContext.js +12 -0
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/ConvolverNode.js +31 -0
- package/lib/module/core/ConvolverNode.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/web-core/AudioContext.js +12 -0
- package/lib/module/web-core/AudioContext.js.map +1 -1
- package/lib/module/web-core/ConvolverNode.js +34 -0
- package/lib/module/web-core/ConvolverNode.js.map +1 -0
- package/lib/module/web-core/ConvolverNodeOptions.js +4 -0
- package/lib/module/web-core/ConvolverNodeOptions.js.map +1 -0
- package/lib/module/web-core/OfflineAudioContext.js +12 -0
- package/lib/module/web-core/OfflineAudioContext.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/BaseAudioContext.d.ts +3 -1
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/core/ConvolverNode.d.ts +12 -0
- package/lib/typescript/core/ConvolverNode.d.ts.map +1 -0
- package/lib/typescript/interfaces.d.ts +5 -0
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +5 -0
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioContext.d.ts +3 -0
- package/lib/typescript/web-core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/BaseAudioContext.d.ts +2 -0
- package/lib/typescript/web-core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/ConvolverNode.d.ts +11 -0
- package/lib/typescript/web-core/ConvolverNode.d.ts.map +1 -0
- package/lib/typescript/web-core/ConvolverNodeOptions.d.ts +6 -0
- package/lib/typescript/web-core/ConvolverNodeOptions.d.ts.map +1 -0
- package/lib/typescript/web-core/OfflineAudioContext.d.ts +3 -0
- package/lib/typescript/web-core/OfflineAudioContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +1 -0
- package/src/api.web.ts +1 -0
- package/src/core/BaseAudioContext.ts +23 -0
- package/src/core/ConvolverNode.ts +35 -0
- package/src/interfaces.ts +11 -0
- package/src/types.ts +7 -0
- package/src/web-core/AudioContext.tsx +25 -0
- package/src/web-core/BaseAudioContext.tsx +2 -0
- package/src/web-core/ConvolverNode.tsx +43 -0
- package/src/web-core/ConvolverNodeOptions.tsx +6 -0
- package/src/web-core/OfflineAudioContext.tsx +25 -0
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#pragma once
|
|
12
12
|
|
|
13
13
|
#include <audioapi/core/sources/AudioScheduledSourceNode.h>
|
|
14
|
+
#include <audioapi/utils/AudioBus.h>
|
|
14
15
|
|
|
15
16
|
#ifndef AUDIO_API_TEST_SUITE
|
|
16
17
|
extern "C" {
|
|
@@ -27,8 +28,35 @@ extern "C" {
|
|
|
27
28
|
#include <memory>
|
|
28
29
|
#include <string>
|
|
29
30
|
#include <atomic>
|
|
31
|
+
#include <utility>
|
|
32
|
+
#ifndef AUDIO_API_TEST_SUITE
|
|
33
|
+
#include <audioapi/utils/SpscChannel.hpp>
|
|
30
34
|
|
|
31
|
-
static
|
|
35
|
+
static constexpr audioapi::channels::spsc::OverflowStrategy STREAMER_NODE_SPSC_OVERFLOW_STRATEGY =
|
|
36
|
+
audioapi::channels::spsc::OverflowStrategy::WAIT_ON_FULL;
|
|
37
|
+
static constexpr audioapi::channels::spsc::WaitStrategy STREAMER_NODE_SPSC_WAIT_STRATEGY =
|
|
38
|
+
audioapi::channels::spsc::WaitStrategy::ATOMIC_WAIT;
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
static constexpr bool VERBOSE = false;
|
|
42
|
+
static constexpr int CHANNEL_CAPACITY = 32;
|
|
43
|
+
|
|
44
|
+
struct StreamingData{
|
|
45
|
+
audioapi::AudioBus bus;
|
|
46
|
+
size_t size;
|
|
47
|
+
StreamingData() = default;
|
|
48
|
+
StreamingData(audioapi::AudioBus b, size_t s) : bus(b), size(s) {}
|
|
49
|
+
StreamingData(const StreamingData& data) : bus(data.bus), size(data.size) {}
|
|
50
|
+
StreamingData(StreamingData&& data) noexcept : bus(std::move(data.bus)), size(data.size) {}
|
|
51
|
+
StreamingData& operator=(const StreamingData& data) {
|
|
52
|
+
if (this == &data) {
|
|
53
|
+
return *this;
|
|
54
|
+
}
|
|
55
|
+
bus = data.bus;
|
|
56
|
+
size = data.size;
|
|
57
|
+
return *this;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
32
60
|
|
|
33
61
|
namespace audioapi {
|
|
34
62
|
|
|
@@ -56,19 +84,20 @@ class StreamerNode : public AudioScheduledSourceNode {
|
|
|
56
84
|
AVCodecParameters* codecpar_;
|
|
57
85
|
AVPacket* pkt_;
|
|
58
86
|
AVFrame* frame_; // Frame that is currently being processed
|
|
59
|
-
AVFrame* pendingFrame_; // Frame that is saved if bufferedBus is full
|
|
60
|
-
std::shared_ptr<AudioBus> bufferedBus_; // audio bus for buffering hls frames
|
|
61
|
-
size_t bufferedBusIndex_; // index in the buffered bus where we write the next frame
|
|
62
|
-
size_t maxBufferSize_; // maximum size of the buffered bus
|
|
63
|
-
int audio_stream_index_; // index of the audio stream channel in the input
|
|
64
87
|
SwrContext* swrCtx_;
|
|
65
88
|
uint8_t** resampledData_; // weird ffmpeg way of using raw byte pointers for resampled data
|
|
89
|
+
|
|
90
|
+
std::shared_ptr<AudioBus> bufferedBus_; // audio bus for buffering hls frames
|
|
91
|
+
size_t bufferedBusSize_; // size of currently buffered bus
|
|
92
|
+
int audio_stream_index_; // index of the audio stream channel in the input
|
|
66
93
|
int maxResampledSamples_;
|
|
67
|
-
|
|
94
|
+
size_t processedSamples_;
|
|
95
|
+
|
|
68
96
|
std::thread streamingThread_;
|
|
69
97
|
std::atomic<bool> streamFlag; // Flag to control the streaming thread
|
|
70
|
-
static constexpr float BUFFER_LENGTH_SECONDS = 5.0f; // Length of the buffer in seconds
|
|
71
98
|
static constexpr int INITIAL_MAX_RESAMPLED_SAMPLES = 8192; // Initial size for resampled data
|
|
99
|
+
channels::spsc::Sender<StreamingData, STREAMER_NODE_SPSC_OVERFLOW_STRATEGY, STREAMER_NODE_SPSC_WAIT_STRATEGY> sender_;
|
|
100
|
+
channels::spsc::Receiver<StreamingData, STREAMER_NODE_SPSC_OVERFLOW_STRATEGY, STREAMER_NODE_SPSC_WAIT_STRATEGY> receiver_;
|
|
72
101
|
|
|
73
102
|
/**
|
|
74
103
|
* @brief Setting up the resampler
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#include <audioapi/core/AudioNode.h>
|
|
2
2
|
#include <audioapi/core/AudioParam.h>
|
|
3
|
+
#include <audioapi/core/effects/ConvolverNode.h>
|
|
3
4
|
#include <audioapi/core/sources/AudioScheduledSourceNode.h>
|
|
4
5
|
#include <audioapi/core/utils/AudioNodeManager.h>
|
|
5
6
|
#include <audioapi/core/utils/Locker.h>
|
|
@@ -221,6 +222,10 @@ inline bool AudioNodeManager::nodeCanBeDestructed(
|
|
|
221
222
|
if constexpr (std::is_base_of_v<AudioScheduledSourceNode, U>) {
|
|
222
223
|
return node.use_count() == 1 &&
|
|
223
224
|
(node->isUnscheduled() || node->isFinished());
|
|
225
|
+
} else if constexpr (std::is_base_of_v<
|
|
226
|
+
ConvolverNode,
|
|
227
|
+
U>) { // convolver overrides disabling behavior
|
|
228
|
+
return node.use_count() == 1 && !node->isEnabled();
|
|
224
229
|
}
|
|
225
230
|
return node.use_count() == 1;
|
|
226
231
|
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// implementation of linear convolution algorithm described in this paper:
|
|
2
|
+
// https://publications.rwth-aachen.de/record/466561/files/466561.pdf page 110
|
|
3
|
+
|
|
4
|
+
#if defined(__ARM_NEON)
|
|
5
|
+
#include <arm_neon.h>
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#include <audioapi/core/sources/AudioBuffer.h>
|
|
9
|
+
#include <audioapi/dsp/Convolver.h>
|
|
10
|
+
#include <audioapi/dsp/VectorMath.h>
|
|
11
|
+
#include <audioapi/utils/AudioArray.h>
|
|
12
|
+
#include <chrono>
|
|
13
|
+
#include <iostream>
|
|
14
|
+
|
|
15
|
+
namespace audioapi {
|
|
16
|
+
|
|
17
|
+
Convolver::Convolver()
|
|
18
|
+
: _blockSize(0),
|
|
19
|
+
_segSize(0),
|
|
20
|
+
_segCount(0),
|
|
21
|
+
_fftComplexSize(0),
|
|
22
|
+
_segments(),
|
|
23
|
+
_segmentsIR(),
|
|
24
|
+
_fftBuffer(0),
|
|
25
|
+
_fft(nullptr),
|
|
26
|
+
_preMultiplied(),
|
|
27
|
+
_current(0),
|
|
28
|
+
_inputBuffer(0) {}
|
|
29
|
+
|
|
30
|
+
void Convolver::reset() {
|
|
31
|
+
_blockSize = 0;
|
|
32
|
+
_segSize = 0;
|
|
33
|
+
_segCount = 0;
|
|
34
|
+
_fftComplexSize = 0;
|
|
35
|
+
_current = 0;
|
|
36
|
+
_fft = nullptr;
|
|
37
|
+
_segments.clear();
|
|
38
|
+
_segmentsIR.clear();
|
|
39
|
+
_preMultiplied.clear();
|
|
40
|
+
_fftBuffer.zero();
|
|
41
|
+
_inputBuffer.zero();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
bool Convolver::init(
|
|
45
|
+
size_t blockSize,
|
|
46
|
+
const audioapi::AudioArray &ir,
|
|
47
|
+
size_t irLen) {
|
|
48
|
+
reset();
|
|
49
|
+
// blockSize must be a power of two
|
|
50
|
+
if ((blockSize & (blockSize - 1))) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Ignore zeros at the end of the impulse response because they only waste
|
|
55
|
+
// computation time
|
|
56
|
+
_blockSize = blockSize;
|
|
57
|
+
_trueSegmentCount = (size_t)(std::ceil((float)irLen / (float)_blockSize));
|
|
58
|
+
while (irLen > 0 && ::fabs(ir[irLen - 1]) < 10e-3) {
|
|
59
|
+
--irLen;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (irLen == 0) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// The length-N is split into P = N/B length-B sub filters
|
|
67
|
+
_segCount = (size_t)(std::ceil((float)irLen / (float)_blockSize));
|
|
68
|
+
_segSize = 2 * _blockSize;
|
|
69
|
+
// size of the FFT is 2B, so the complex size is B+1, due to the
|
|
70
|
+
// complex-conjugate symmetricity
|
|
71
|
+
_fftComplexSize = _segSize / 2 + 1;
|
|
72
|
+
_fft = std::make_shared<dsp::FFT>((int)_segSize);
|
|
73
|
+
_fftBuffer.resize(_segSize);
|
|
74
|
+
|
|
75
|
+
// segments preparation
|
|
76
|
+
for (int i = 0; i < _segCount; ++i) {
|
|
77
|
+
aligned_vec_complex vec(_fftComplexSize, std::complex<float>(0.0f, 0.0f));
|
|
78
|
+
_segments.push_back(vec);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ir preparation
|
|
82
|
+
for (int i = 0; i < _segCount; ++i) {
|
|
83
|
+
aligned_vec_complex segment(_fftComplexSize);
|
|
84
|
+
const size_t remainingSamples = irLen - (i * _blockSize);
|
|
85
|
+
const size_t samplesToCopy = std::min(_blockSize, remainingSamples);
|
|
86
|
+
|
|
87
|
+
if (samplesToCopy > 0) {
|
|
88
|
+
memcpy(
|
|
89
|
+
_fftBuffer.getData(),
|
|
90
|
+
ir.getData() + i * _blockSize,
|
|
91
|
+
samplesToCopy * sizeof(float));
|
|
92
|
+
}
|
|
93
|
+
// Each sub filter is zero-padded to length 2B and transformed using a
|
|
94
|
+
// 2B-point real-to-complex FFT.
|
|
95
|
+
memset(_fftBuffer.getData() + _blockSize, 0, _blockSize * sizeof(float));
|
|
96
|
+
_fft->doFFT(_fftBuffer.getData(), segment);
|
|
97
|
+
segment.at(0).imag(0.0f); // ensure DC component is real
|
|
98
|
+
_segmentsIR.push_back(segment);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
_preMultiplied = aligned_vec_complex(_fftComplexSize);
|
|
102
|
+
_inputBuffer.resize(_segSize);
|
|
103
|
+
_current = 0;
|
|
104
|
+
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// @brief Fast pairwise complex multiplication using ARM NEON intrinsics
|
|
109
|
+
/// @param ir Impulse response
|
|
110
|
+
/// @param audio Input audio signal
|
|
111
|
+
/// @param pre Output buffer for pre-multiplied results
|
|
112
|
+
/// @note IMPORTANT: ir, audio, and pre must be the same size and should be
|
|
113
|
+
/// aligned to 16 bytes for optimal performance
|
|
114
|
+
void pairwise_complex_multiply_fast(
|
|
115
|
+
const Convolver::aligned_vec_complex &ir,
|
|
116
|
+
const Convolver::aligned_vec_complex &audio,
|
|
117
|
+
Convolver::aligned_vec_complex &pre) {
|
|
118
|
+
size_t n = ir.size();
|
|
119
|
+
|
|
120
|
+
/// @note Using ARM NEON intrinsics for SIMD optimization
|
|
121
|
+
/// This implementation is on average 2x faster than the scalar version on ARM
|
|
122
|
+
/// architectures With 16-byte alignment it can be even faster up to 2.5x
|
|
123
|
+
#ifdef __ARM_NEON
|
|
124
|
+
size_t j = 0;
|
|
125
|
+
|
|
126
|
+
// Main vector loop: process 4 complex samples (8 floats) per iteration using
|
|
127
|
+
// vld2q/vst2q deinterleave
|
|
128
|
+
for (; j <= n - 4; j += 4) {
|
|
129
|
+
// load de-interleaved real/imag for 4 complex values
|
|
130
|
+
float32x4x2_t ir_de = vld2q_f32(reinterpret_cast<const float *>(&ir[j]));
|
|
131
|
+
float32x4x2_t a_de = vld2q_f32(reinterpret_cast<const float *>(&audio[j]));
|
|
132
|
+
float32x4x2_t pre_de = vld2q_f32(reinterpret_cast<float *>(&pre[j]));
|
|
133
|
+
|
|
134
|
+
float32x4_t ir_re = ir_de.val[0];
|
|
135
|
+
float32x4_t ir_im = ir_de.val[1];
|
|
136
|
+
float32x4_t a_re = a_de.val[0];
|
|
137
|
+
float32x4_t a_im = a_de.val[1];
|
|
138
|
+
|
|
139
|
+
// real = ir_re * a_re - ir_im * a_im
|
|
140
|
+
float32x4_t real = vmulq_f32(ir_re, a_re);
|
|
141
|
+
real = vmlsq_f32(real, ir_im, a_im);
|
|
142
|
+
// imag = ir_re * a_im + ir_im * a_re
|
|
143
|
+
float32x4_t imag = vmulq_f32(ir_re, a_im);
|
|
144
|
+
imag = vmlaq_f32(imag, ir_im, a_re);
|
|
145
|
+
|
|
146
|
+
// accumulate into pre
|
|
147
|
+
float32x4_t new_re = vaddq_f32(pre_de.val[0], real);
|
|
148
|
+
float32x4_t new_im = vaddq_f32(pre_de.val[1], imag);
|
|
149
|
+
|
|
150
|
+
float32x4x2_t out_de;
|
|
151
|
+
out_de.val[0] = new_re;
|
|
152
|
+
out_de.val[1] = new_im;
|
|
153
|
+
|
|
154
|
+
vst2q_f32(reinterpret_cast<float *>(&pre[j]), out_de);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Tail
|
|
158
|
+
for (; j < n; ++j) {
|
|
159
|
+
pre[j] += ir[j] * audio[j];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
#else
|
|
163
|
+
// Fallback scalar implementation
|
|
164
|
+
for (size_t i = 0; i < n; ++i) {
|
|
165
|
+
pre[i] += ir[i] * audio[i];
|
|
166
|
+
}
|
|
167
|
+
#endif
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
void Convolver::process(float *data, float *outputData) {
|
|
171
|
+
// The input buffer acts as a 2B-point sliding window of the input signal.
|
|
172
|
+
// With each new input block, the right half of the input buffer is shifted
|
|
173
|
+
// to the left and the new block is stored in the right half.
|
|
174
|
+
memmove(
|
|
175
|
+
_inputBuffer.getData(),
|
|
176
|
+
_inputBuffer.getData() + _blockSize,
|
|
177
|
+
_blockSize * sizeof(float));
|
|
178
|
+
memcpy(_inputBuffer.getData() + _blockSize, data, _blockSize * sizeof(float));
|
|
179
|
+
|
|
180
|
+
// All contents (DFT spectra) in the FDL are shifted up by one slot.
|
|
181
|
+
_current = (_current > 0) ? _current - 1 : _segCount - 1;
|
|
182
|
+
// A 2B-point real-to-complex FFT is computed from the input buffer,
|
|
183
|
+
// resulting in B+1 complex-conjugate symmetric DFT coefficients. The
|
|
184
|
+
// result is stored in the first FDL slot.
|
|
185
|
+
// _current marks first FDL slot, which is the current input block.
|
|
186
|
+
_fft->doFFT(_inputBuffer.getData(), _segments[_current]);
|
|
187
|
+
_segments[_current][0].imag(0.0f); // ensure DC component is real
|
|
188
|
+
|
|
189
|
+
// The P sub filter spectra are pairwisely multiplied with the input spectra
|
|
190
|
+
// in the FDL. The results are accumulated in the frequency-domain.
|
|
191
|
+
memset(
|
|
192
|
+
_preMultiplied.data(),
|
|
193
|
+
0,
|
|
194
|
+
_preMultiplied.size() * sizeof(std::complex<float>));
|
|
195
|
+
// this is a bottleneck of the algorithm
|
|
196
|
+
for (int i = 0; i < _segCount; ++i) {
|
|
197
|
+
const int indexAudio = (_current + i) % _segCount;
|
|
198
|
+
const auto &impulseResponseSegment = _segmentsIR[i];
|
|
199
|
+
const auto &audioSegment = _segments[indexAudio];
|
|
200
|
+
pairwise_complex_multiply_fast(
|
|
201
|
+
impulseResponseSegment, audioSegment, _preMultiplied);
|
|
202
|
+
}
|
|
203
|
+
// Of the accumulated spectral convolutions, an 2B-point complex-to-real
|
|
204
|
+
// IFFT is computed. From the resulting 2B samples, the left half is
|
|
205
|
+
// discarded and the right half is returned as the next output block.
|
|
206
|
+
_fft->doInverseFFT(_preMultiplied, _fftBuffer.getData());
|
|
207
|
+
|
|
208
|
+
memcpy(
|
|
209
|
+
outputData,
|
|
210
|
+
_fftBuffer.getData() + _blockSize,
|
|
211
|
+
_blockSize * sizeof(float));
|
|
212
|
+
}
|
|
213
|
+
} // namespace audioapi
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <audioapi/utils/AudioArray.h>
|
|
4
|
+
#include <audioapi/dsp/FFT.h>
|
|
5
|
+
#include <vector>
|
|
6
|
+
#include <cstring>
|
|
7
|
+
#include <complex>
|
|
8
|
+
#include <memory>
|
|
9
|
+
#include <audioapi/utils/AlignedAllocator.hpp>
|
|
10
|
+
|
|
11
|
+
namespace audioapi {
|
|
12
|
+
|
|
13
|
+
class AudioBuffer;
|
|
14
|
+
|
|
15
|
+
class Convolver {
|
|
16
|
+
using aligned_vec_complex =
|
|
17
|
+
std::vector<std::complex<float>, AlignedAllocator<std::complex<float>, 16>>;
|
|
18
|
+
|
|
19
|
+
public:
|
|
20
|
+
Convolver();
|
|
21
|
+
bool init(size_t blockSize, const AudioArray &ir, size_t irLen);
|
|
22
|
+
void process(float* inputData, float* outputData);
|
|
23
|
+
void reset();
|
|
24
|
+
inline size_t getSegCount() const { return _trueSegmentCount; }
|
|
25
|
+
|
|
26
|
+
private:
|
|
27
|
+
size_t _trueSegmentCount;
|
|
28
|
+
size_t _blockSize;
|
|
29
|
+
size_t _segSize;
|
|
30
|
+
size_t _segCount;
|
|
31
|
+
size_t _fftComplexSize;
|
|
32
|
+
std::vector<aligned_vec_complex> _segments;
|
|
33
|
+
std::vector<aligned_vec_complex> _segmentsIR;
|
|
34
|
+
AudioArray _fftBuffer;
|
|
35
|
+
std::shared_ptr<dsp::FFT> _fft;
|
|
36
|
+
aligned_vec_complex _preMultiplied;
|
|
37
|
+
size_t _current;
|
|
38
|
+
AudioArray _inputBuffer;
|
|
39
|
+
|
|
40
|
+
friend void pairwise_complex_multiply_fast(
|
|
41
|
+
const aligned_vec_complex& ir,
|
|
42
|
+
const aligned_vec_complex& audio,
|
|
43
|
+
aligned_vec_complex& pre);
|
|
44
|
+
};
|
|
45
|
+
} // namespace audioapi
|
|
@@ -12,30 +12,4 @@ FFT::~FFT() {
|
|
|
12
12
|
pffft_aligned_free(work_);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
void FFT::doFFT(float *in, std::vector<std::complex<float>> &out) {
|
|
16
|
-
pffft_transform_ordered(
|
|
17
|
-
pffftSetup_,
|
|
18
|
-
in,
|
|
19
|
-
reinterpret_cast<float *>(&out[0]),
|
|
20
|
-
work_,
|
|
21
|
-
PFFFT_FORWARD);
|
|
22
|
-
|
|
23
|
-
dsp::multiplyByScalar(
|
|
24
|
-
reinterpret_cast<float *>(&out[0]),
|
|
25
|
-
0.5f,
|
|
26
|
-
reinterpret_cast<float *>(&out[0]),
|
|
27
|
-
size_ * 2);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
void FFT::doInverseFFT(std::vector<std::complex<float>> &in, float *out) {
|
|
31
|
-
pffft_transform_ordered(
|
|
32
|
-
pffftSetup_,
|
|
33
|
-
reinterpret_cast<float *>(&in[0]),
|
|
34
|
-
out,
|
|
35
|
-
work_,
|
|
36
|
-
PFFFT_BACKWARD);
|
|
37
|
-
|
|
38
|
-
dsp::multiplyByScalar(out, 1.0f / static_cast<float>(size_), out, size_);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
15
|
} // namespace audioapi::dsp
|
|
@@ -16,8 +16,32 @@ class FFT {
|
|
|
16
16
|
explicit FFT(int size);
|
|
17
17
|
~FFT();
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
void
|
|
19
|
+
template<typename Allocator>
|
|
20
|
+
void doFFT(float *in, std::vector<std::complex<float>, Allocator> &out) {
|
|
21
|
+
pffft_transform_ordered(
|
|
22
|
+
pffftSetup_,
|
|
23
|
+
in,
|
|
24
|
+
reinterpret_cast<float *>(&out[0]),
|
|
25
|
+
work_,
|
|
26
|
+
PFFFT_FORWARD);
|
|
27
|
+
// this is a possible place for bugs and mistakes
|
|
28
|
+
// due to pffft implementation and how it stores results
|
|
29
|
+
// keep this information in mind
|
|
30
|
+
// out[0].real = DC component - should be pure real
|
|
31
|
+
// out[0].imag = Nyquist component - should be pure real
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
template<typename Allocator>
|
|
35
|
+
void doInverseFFT(std::vector<std::complex<float>, Allocator> &in, float *out) {
|
|
36
|
+
pffft_transform_ordered(
|
|
37
|
+
pffftSetup_,
|
|
38
|
+
reinterpret_cast<float *>(&in[0]),
|
|
39
|
+
out,
|
|
40
|
+
work_,
|
|
41
|
+
PFFFT_BACKWARD);
|
|
42
|
+
|
|
43
|
+
dsp::multiplyByScalar(out, 1.0f / static_cast<float>(size_), out, size_);
|
|
44
|
+
}
|
|
21
45
|
|
|
22
46
|
private:
|
|
23
47
|
int size_;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include <cstddef>
|
|
3
|
+
#include <new>
|
|
4
|
+
|
|
5
|
+
template<typename T, std::size_t Align = 16>
|
|
6
|
+
class AlignedAllocator {
|
|
7
|
+
public:
|
|
8
|
+
using value_type = T;
|
|
9
|
+
using size_type = std::size_t;
|
|
10
|
+
using difference_type = std::ptrdiff_t;
|
|
11
|
+
|
|
12
|
+
AlignedAllocator() noexcept = default;
|
|
13
|
+
template<class U> AlignedAllocator(const AlignedAllocator<U, Align>&) noexcept {}
|
|
14
|
+
|
|
15
|
+
T* allocate(std::size_t n) {
|
|
16
|
+
// We want to maximize performance on hot paths, so we hint unlikely branches
|
|
17
|
+
if (n == 0) [[ unlikely ]] {
|
|
18
|
+
return nullptr;
|
|
19
|
+
}
|
|
20
|
+
std::size_t bytes = n * sizeof(T);
|
|
21
|
+
// C++17 aligned new
|
|
22
|
+
void* p = ::operator new(bytes, std::align_val_t(Align));
|
|
23
|
+
|
|
24
|
+
// We have more serious problems if this happens than speed concerns
|
|
25
|
+
// so we can opt the branch prediction
|
|
26
|
+
if (!p) [[ unlikely ]] {
|
|
27
|
+
throw std::bad_alloc();
|
|
28
|
+
}
|
|
29
|
+
return static_cast<T*>(p);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
void deallocate(T* p, std::size_t) noexcept {
|
|
33
|
+
::operator delete(p, std::align_val_t(Align));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Rebind allocator to type U (required by std::vector)
|
|
37
|
+
template<class U>
|
|
38
|
+
struct rebind { using other = AlignedAllocator<U, Align>; };
|
|
39
|
+
|
|
40
|
+
// Comparison operators (required by std::vector)
|
|
41
|
+
template<typename U, std::size_t UAlign>
|
|
42
|
+
bool operator==(const AlignedAllocator<U, UAlign>&) const noexcept {
|
|
43
|
+
return Align == UAlign;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
template<typename U, std::size_t UAlign>
|
|
47
|
+
bool operator!=(const AlignedAllocator<U, UAlign>&) const noexcept {
|
|
48
|
+
return Align != UAlign;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -34,6 +34,34 @@ AudioBus::AudioBus(const AudioBus &other) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
AudioBus::AudioBus(AudioBus &&other) noexcept
|
|
38
|
+
: channels_(std::move(other.channels_)),
|
|
39
|
+
numberOfChannels_(other.numberOfChannels_),
|
|
40
|
+
sampleRate_(other.sampleRate_),
|
|
41
|
+
size_(other.size_) {
|
|
42
|
+
other.numberOfChannels_ = 0;
|
|
43
|
+
other.sampleRate_ = 0.0f;
|
|
44
|
+
other.size_ = 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
AudioBus &AudioBus::operator=(const AudioBus &other) {
|
|
48
|
+
if (this == &other) {
|
|
49
|
+
return *this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
numberOfChannels_ = other.numberOfChannels_;
|
|
53
|
+
sampleRate_ = other.sampleRate_;
|
|
54
|
+
size_ = other.size_;
|
|
55
|
+
|
|
56
|
+
createChannels();
|
|
57
|
+
|
|
58
|
+
for (int i = 0; i < numberOfChannels_; i += 1) {
|
|
59
|
+
channels_[i] = std::make_shared<AudioArray>(*other.channels_[i]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return *this;
|
|
63
|
+
}
|
|
64
|
+
|
|
37
65
|
AudioBus::~AudioBus() {
|
|
38
66
|
channels_.clear();
|
|
39
67
|
}
|
|
@@ -24,8 +24,11 @@ class AudioBus {
|
|
|
24
24
|
ChannelSurroundRight = 5,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
explicit AudioBus() = default;
|
|
27
28
|
explicit AudioBus(size_t size, int numberOfChannels, float sampleRate);
|
|
28
29
|
AudioBus(const AudioBus &other);
|
|
30
|
+
AudioBus(AudioBus &&other) noexcept;
|
|
31
|
+
AudioBus& operator=(const AudioBus& other);
|
|
29
32
|
|
|
30
33
|
~AudioBus();
|
|
31
34
|
|
|
@@ -19,35 +19,37 @@ FetchContent_MakeAvailable(googletest)
|
|
|
19
19
|
|
|
20
20
|
enable_testing()
|
|
21
21
|
|
|
22
|
+
set(REACT_NATIVE_AUDIO_API_DIR "${ROOT}/node_modules/react-native-audio-api")
|
|
23
|
+
|
|
22
24
|
file(GLOB_RECURSE RNAUDIOAPI_SRC
|
|
23
25
|
CONFIGURE_DEPENDS
|
|
24
|
-
"${
|
|
25
|
-
"${
|
|
26
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/*.cpp"
|
|
27
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/android/src/main/cpp/audioapi/android/core/utils/AudioDecoder.cpp"
|
|
26
28
|
)
|
|
27
29
|
|
|
28
30
|
# exclude HostObjects from tests
|
|
29
31
|
list(FILTER RNAUDIOAPI_SRC EXCLUDE REGEX ".*/audioapi/HostObjects/.*\\.cpp$")
|
|
30
32
|
|
|
31
33
|
list(REMOVE_ITEM RNAUDIOAPI_SRC
|
|
32
|
-
"${
|
|
33
|
-
"${
|
|
34
|
-
"${
|
|
35
|
-
"${
|
|
36
|
-
"${
|
|
37
|
-
"${
|
|
38
|
-
"${
|
|
39
|
-
"${
|
|
34
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/core/AudioContext.cpp"
|
|
35
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/core/effects/WorkletNode.cpp"
|
|
36
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/core/effects/WorkletProcessingNode.cpp"
|
|
37
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/core/sources/WorkletSourceNode.cpp"
|
|
38
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/core/sources/StreamerNode.cpp"
|
|
39
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/core/sources/StreamerNode.h"
|
|
40
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.cpp"
|
|
41
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.h"
|
|
40
42
|
)
|
|
41
43
|
|
|
42
44
|
file(GLOB_RECURSE RNAUDIOAPI_LIBS
|
|
43
45
|
CONFIGURE_DEPENDS
|
|
44
|
-
"${
|
|
45
|
-
"${
|
|
46
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/libs/*.c"
|
|
47
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/libs/*.h"
|
|
46
48
|
)
|
|
47
49
|
|
|
48
50
|
list(REMOVE_ITEM RNAUDIOAPI_LIBS
|
|
49
|
-
"${
|
|
50
|
-
"${
|
|
51
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/libs/miniaudio/decoders/libopus/miniaudio_libopus.c"
|
|
52
|
+
"${REACT_NATIVE_AUDIO_API_DIR}/common/cpp/audioapi/libs/miniaudio/decoders/libvorbis/miniaudio_libvorbis.c"
|
|
51
53
|
)
|
|
52
54
|
|
|
53
55
|
add_library(rnaudioapi STATIC ${RNAUDIOAPI_SRC})
|
package/lib/commonjs/api.js
CHANGED
|
@@ -117,6 +117,12 @@ Object.defineProperty(exports, "ContextState", {
|
|
|
117
117
|
return _types.ContextState;
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
|
+
Object.defineProperty(exports, "ConvolverNode", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _ConvolverNode.default;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
120
126
|
Object.defineProperty(exports, "GainNode", {
|
|
121
127
|
enumerable: true,
|
|
122
128
|
get: function () {
|
|
@@ -309,6 +315,7 @@ var _AudioRecorder = _interopRequireDefault(require("./core/AudioRecorder"));
|
|
|
309
315
|
var _StreamerNode = _interopRequireDefault(require("./core/StreamerNode"));
|
|
310
316
|
var _ConstantSourceNode = _interopRequireDefault(require("./core/ConstantSourceNode"));
|
|
311
317
|
var _system = _interopRequireDefault(require("./system"));
|
|
318
|
+
var _ConvolverNode = _interopRequireDefault(require("./core/ConvolverNode"));
|
|
312
319
|
var _useSystemVolume = _interopRequireDefault(require("./hooks/useSystemVolume"));
|
|
313
320
|
var _AudioDecoder = require("./core/AudioDecoder");
|
|
314
321
|
var _AudioStretcher = _interopRequireDefault(require("./core/AudioStretcher"));
|
package/lib/commonjs/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_specs","require","_WorkletNode","_interopRequireDefault","_WorkletSourceNode","_WorkletProcessingNode","_RecorderAdapterNode","_AudioBuffer","_AudioBufferSourceNode","_AudioBufferQueueSourceNode","_AudioContext","_OfflineAudioContext","_AudioDestinationNode","_AudioNode","_AnalyserNode","_AudioParam","_AudioScheduledSourceNode","_BaseAudioContext","_BiquadFilterNode","_GainNode","_OscillatorNode","_StereoPannerNode","_AudioRecorder","_StreamerNode","_ConstantSourceNode","_system","_useSystemVolume","_AudioDecoder","_AudioStretcher","_types","_types2","_errors","e","__esModule","default","global","createAudioContext","createOfflineAudioContext","createAudioRecorder","createAudioDecoder","createAudioStretcher","AudioEventEmitter","NativeAudioAPIModule","Error","install"],"sourceRoot":"../../src","sources":["api.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_specs","require","_WorkletNode","_interopRequireDefault","_WorkletSourceNode","_WorkletProcessingNode","_RecorderAdapterNode","_AudioBuffer","_AudioBufferSourceNode","_AudioBufferQueueSourceNode","_AudioContext","_OfflineAudioContext","_AudioDestinationNode","_AudioNode","_AnalyserNode","_AudioParam","_AudioScheduledSourceNode","_BaseAudioContext","_BiquadFilterNode","_GainNode","_OscillatorNode","_StereoPannerNode","_AudioRecorder","_StreamerNode","_ConstantSourceNode","_system","_ConvolverNode","_useSystemVolume","_AudioDecoder","_AudioStretcher","_types","_types2","_errors","e","__esModule","default","global","createAudioContext","createOfflineAudioContext","createAudioRecorder","createAudioDecoder","createAudioStretcher","AudioEventEmitter","NativeAudioAPIModule","Error","install"],"sourceRoot":"../../src","sources":["api.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,CAAAF,OAAA;AACA,IAAA0B,gBAAA,GAAAxB,sBAAA,CAAAF,OAAA;AACA,IAAA2B,aAAA,GAAA3B,OAAA;AACA,IAAA4B,eAAA,GAAA1B,sBAAA,CAAAF,OAAA;AAEA,IAAA6B,MAAA,GAAA7B,OAAA;AAWA,IAAA8B,OAAA,GAAA9B,OAAA;AAUA,IAAA+B,OAAA,GAAA/B,OAAA;AAMkB,SAAAE,uBAAA8B,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAlGlB;;AAwBA;;AAEA,IACEG,MAAM,CAACC,kBAAkB,IAAI,IAAI,IACjCD,MAAM,CAACE,yBAAyB,IAAI,IAAI,IACxCF,MAAM,CAACG,mBAAmB,IAAI,IAAI,IAClCH,MAAM,CAACI,kBAAkB,IAAI,IAAI,IACjCJ,MAAM,CAACK,oBAAoB,IAAI,IAAI,IACnCL,MAAM,CAACM,iBAAiB,IAAI,IAAI,EAChC;EACA,IAAI,CAACC,2BAAoB,EAAE;IACzB,MAAM,IAAIC,KAAK,CACb,iFACF,CAAC;EACH;EAEAD,2BAAoB,CAACE,OAAO,CAAC,CAAC;AAChC","ignoreList":[]}
|
package/lib/commonjs/api.web.js
CHANGED
|
@@ -19,6 +19,7 @@ var _exportNames = {
|
|
|
19
19
|
OscillatorNode: true,
|
|
20
20
|
StereoPannerNode: true,
|
|
21
21
|
ConstantSourceNode: true,
|
|
22
|
+
ConvolverNode: true,
|
|
22
23
|
OscillatorType: true,
|
|
23
24
|
BiquadFilterType: true,
|
|
24
25
|
ChannelCountMode: true,
|
|
@@ -129,6 +130,12 @@ Object.defineProperty(exports, "ContextState", {
|
|
|
129
130
|
return _types.ContextState;
|
|
130
131
|
}
|
|
131
132
|
});
|
|
133
|
+
Object.defineProperty(exports, "ConvolverNode", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function () {
|
|
136
|
+
return _ConvolverNode.default;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
132
139
|
Object.defineProperty(exports, "GainNode", {
|
|
133
140
|
enumerable: true,
|
|
134
141
|
get: function () {
|
|
@@ -258,6 +265,7 @@ var _GainNode = _interopRequireDefault(require("./web-core/GainNode"));
|
|
|
258
265
|
var _OscillatorNode = _interopRequireDefault(require("./web-core/OscillatorNode"));
|
|
259
266
|
var _StereoPannerNode = _interopRequireDefault(require("./web-core/StereoPannerNode"));
|
|
260
267
|
var _ConstantSourceNode = _interopRequireDefault(require("./web-core/ConstantSourceNode"));
|
|
268
|
+
var _ConvolverNode = _interopRequireDefault(require("./web-core/ConvolverNode"));
|
|
261
269
|
var _custom = require("./web-core/custom");
|
|
262
270
|
Object.keys(_custom).forEach(function (key) {
|
|
263
271
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_AudioBuffer","_interopRequireDefault","require","_AudioBufferSourceNode","_AudioContext","_OfflineAudioContext","_AudioDestinationNode","_AudioNode","_AnalyserNode","_AudioParam","_AudioScheduledSourceNode","_BaseAudioContext","_BiquadFilterNode","_GainNode","_OscillatorNode","_StereoPannerNode","_ConstantSourceNode","_custom","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_types","_types2","_errors","e","__esModule","default"],"sourceRoot":"../../src","sources":["api.web.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_AudioBuffer","_interopRequireDefault","require","_AudioBufferSourceNode","_AudioContext","_OfflineAudioContext","_AudioDestinationNode","_AudioNode","_AnalyserNode","_AudioParam","_AudioScheduledSourceNode","_BaseAudioContext","_BiquadFilterNode","_GainNode","_OscillatorNode","_StereoPannerNode","_ConstantSourceNode","_ConvolverNode","_custom","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_types","_types2","_errors","e","__esModule","default"],"sourceRoot":"../../src","sources":["api.web.ts"],"mappings":";;;;;;;;;;;;;;;;;;;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