react-native-audio-api 0.1.0 → 0.3.0-rc1
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/README.md +10 -8
- package/RNAudioAPI.podspec +5 -0
- package/android/CMakeLists.txt +21 -10
- package/android/libs/fftw3/arm64-v8a/libfftw3.a +0 -0
- package/android/libs/fftw3/armeabi-v7a/libfftw3.a +0 -0
- package/android/libs/fftw3/x86/libfftw3.a +0 -0
- package/android/libs/fftw3/x86_64/libfftw3.a +0 -0
- package/android/libs/include/fftw3/fftw3.h +413 -0
- package/android/src/main/cpp/AudioPlayer/AudioPlayer.cpp +32 -2
- package/android/src/main/cpp/AudioPlayer/AudioPlayer.h +6 -2
- package/common/cpp/AudioAPIInstaller/AudioAPIInstallerHostObject.cpp +5 -3
- package/common/cpp/AudioAPIInstaller/AudioAPIInstallerHostObject.h +5 -1
- package/common/cpp/HostObjects/AudioBufferHostObject.cpp +6 -0
- package/common/cpp/HostObjects/AudioBufferSourceNodeHostObject.cpp +13 -1
- package/common/cpp/HostObjects/AudioContextHostObject.cpp +12 -149
- package/common/cpp/HostObjects/AudioContextHostObject.h +8 -14
- package/common/cpp/HostObjects/AudioNodeHostObject.cpp +0 -6
- package/common/cpp/HostObjects/BaseAudioContextHostObject.cpp +240 -0
- package/common/cpp/HostObjects/BaseAudioContextHostObject.h +41 -0
- package/common/cpp/HostObjects/BiquadFilterNodeHostObject.cpp +44 -0
- package/common/cpp/HostObjects/OscillatorNodeHostObject.cpp +21 -0
- package/common/cpp/HostObjects/OscillatorNodeHostObject.h +1 -0
- package/common/cpp/HostObjects/PeriodicWaveHostObject.cpp +33 -0
- package/common/cpp/HostObjects/PeriodicWaveHostObject.h +33 -0
- package/common/cpp/core/AudioArray.cpp +117 -0
- package/common/cpp/core/AudioArray.h +48 -0
- package/common/cpp/core/AudioBuffer.cpp +23 -80
- package/common/cpp/core/AudioBuffer.h +12 -13
- package/common/cpp/core/AudioBufferSourceNode.cpp +112 -25
- package/common/cpp/core/AudioBufferSourceNode.h +10 -6
- package/common/cpp/core/AudioBus.cpp +518 -0
- package/common/cpp/core/AudioBus.h +83 -0
- package/common/cpp/core/AudioContext.cpp +7 -77
- package/common/cpp/core/AudioContext.h +3 -60
- package/common/cpp/core/AudioDestinationNode.cpp +27 -15
- package/common/cpp/core/AudioDestinationNode.h +13 -5
- package/common/cpp/core/AudioNode.cpp +184 -22
- package/common/cpp/core/AudioNode.h +37 -37
- package/common/cpp/core/AudioNodeManager.cpp +75 -0
- package/common/cpp/core/AudioNodeManager.h +42 -0
- package/common/cpp/core/AudioParam.cpp +8 -11
- package/common/cpp/core/AudioParam.h +8 -8
- package/common/cpp/core/AudioScheduledSourceNode.cpp +19 -5
- package/common/cpp/core/AudioScheduledSourceNode.h +6 -2
- package/common/cpp/core/BaseAudioContext.cpp +191 -0
- package/common/cpp/core/BaseAudioContext.h +87 -0
- package/common/cpp/core/BiquadFilterNode.cpp +92 -69
- package/common/cpp/core/BiquadFilterNode.h +53 -57
- package/common/cpp/core/GainNode.cpp +12 -12
- package/common/cpp/core/GainNode.h +5 -3
- package/common/cpp/core/OscillatorNode.cpp +38 -29
- package/common/cpp/core/OscillatorNode.h +29 -69
- package/common/cpp/core/ParamChange.h +6 -6
- package/common/cpp/core/PeriodicWave.cpp +362 -0
- package/common/cpp/core/PeriodicWave.h +119 -0
- package/common/cpp/core/StereoPannerNode.cpp +31 -30
- package/common/cpp/core/StereoPannerNode.h +6 -6
- package/common/cpp/types/BiquadFilterType.h +19 -0
- package/common/cpp/types/ChannelCountMode.h +10 -0
- package/common/cpp/types/ChannelInterpretation.h +10 -0
- package/common/cpp/types/ContextState.h +10 -0
- package/common/cpp/types/OscillatorType.h +11 -0
- package/common/cpp/utils/FFTFrame.h +67 -0
- package/common/cpp/utils/JsiPromise.cpp +59 -0
- package/common/cpp/utils/JsiPromise.h +42 -0
- package/common/cpp/utils/Locker.h +49 -0
- package/common/cpp/utils/VectorMath.cpp +88 -3
- package/common/cpp/utils/VectorMath.h +7 -1
- package/common/cpp/utils/android/FFTFrame.cpp +23 -0
- package/common/cpp/utils/ios/FFTFrame.cpp +29 -0
- package/common/cpp/wrappers/AudioBufferSourceNodeWrapper.cpp +10 -0
- package/common/cpp/wrappers/AudioBufferSourceNodeWrapper.h +3 -2
- package/common/cpp/wrappers/AudioBufferWrapper.h +5 -5
- package/common/cpp/wrappers/AudioContextWrapper.cpp +7 -60
- package/common/cpp/wrappers/AudioContextWrapper.h +5 -26
- package/common/cpp/wrappers/AudioNodeWrapper.h +5 -5
- package/common/cpp/wrappers/AudioParamWrapper.h +4 -4
- package/common/cpp/wrappers/BaseAudioContextWrapper.cpp +83 -0
- package/common/cpp/wrappers/BaseAudioContextWrapper.h +50 -0
- package/common/cpp/wrappers/BiquadFilterNodeWrapper.cpp +9 -0
- package/common/cpp/wrappers/BiquadFilterNodeWrapper.h +9 -4
- package/common/cpp/wrappers/GainNodeWrapper.h +1 -1
- package/common/cpp/wrappers/OscillatorNodeWrapper.cpp +6 -0
- package/common/cpp/wrappers/OscillatorNodeWrapper.h +5 -2
- package/common/cpp/wrappers/PeriodicWaveWrapper.h +17 -0
- package/common/cpp/wrappers/StereoPannerNodeWrapper.h +1 -1
- package/ios/AudioAPIModule.h +20 -1
- package/ios/AudioAPIModule.mm +6 -4
- package/ios/AudioDecoder/AudioDecoder.h +17 -0
- package/ios/AudioDecoder/AudioDecoder.m +167 -0
- package/ios/AudioDecoder/IOSAudioDecoder.h +26 -0
- package/ios/AudioDecoder/IOSAudioDecoder.mm +40 -0
- package/ios/AudioPlayer/AudioPlayer.h +3 -2
- package/ios/AudioPlayer/AudioPlayer.m +14 -17
- package/ios/AudioPlayer/IOSAudioPlayer.h +7 -3
- package/ios/AudioPlayer/IOSAudioPlayer.mm +31 -7
- package/lib/module/core/AudioBuffer.js +37 -0
- package/lib/module/core/AudioBuffer.js.map +1 -0
- package/lib/module/core/AudioBufferSourceNode.js +28 -0
- package/lib/module/core/AudioBufferSourceNode.js.map +1 -0
- package/lib/module/core/AudioContext.js +10 -0
- package/lib/module/core/AudioContext.js.map +1 -0
- package/lib/module/core/AudioDestinationNode.js +7 -0
- package/lib/module/core/AudioDestinationNode.js.map +1 -0
- package/lib/module/core/AudioNode.js +22 -0
- package/lib/module/core/AudioNode.js.map +1 -0
- package/lib/module/core/AudioParam.js +35 -0
- package/lib/module/core/AudioParam.js.map +1 -0
- package/lib/module/core/AudioScheduledSourceNode.js +28 -0
- package/lib/module/core/AudioScheduledSourceNode.js.map +1 -0
- package/lib/module/core/BaseAudioContext.js +62 -0
- package/lib/module/core/BaseAudioContext.js.map +1 -0
- package/lib/module/core/BiquadFilterNode.js +25 -0
- package/lib/module/core/BiquadFilterNode.js.map +1 -0
- package/lib/module/core/GainNode.js +9 -0
- package/lib/module/core/GainNode.js.map +1 -0
- package/lib/module/core/OscillatorNode.js +24 -0
- package/lib/module/core/OscillatorNode.js.map +1 -0
- package/lib/module/core/PeriodicWave.js +8 -0
- package/lib/module/core/PeriodicWave.js.map +1 -0
- package/lib/module/core/StereoPannerNode.js +9 -0
- package/lib/module/core/StereoPannerNode.js.map +1 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/errors/IndexSizeError.js +8 -0
- package/lib/module/errors/IndexSizeError.js.map +1 -0
- package/lib/module/errors/InvalidAccessError.js +8 -0
- package/lib/module/errors/InvalidAccessError.js.map +1 -0
- package/lib/module/errors/InvalidStateError.js +8 -0
- package/lib/module/errors/InvalidStateError.js.map +1 -0
- package/lib/module/errors/RangeError.js +8 -0
- package/lib/module/errors/RangeError.js.map +1 -0
- package/lib/module/errors/index.js +5 -0
- package/lib/module/errors/index.js.map +1 -0
- package/lib/module/index.js +212 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +18 -0
- package/lib/module/index.native.js.map +1 -0
- package/lib/module/interfaces.js +2 -0
- package/lib/module/interfaces.js.map +1 -0
- package/lib/module/utils/resolveAudioSource.js +10 -0
- package/lib/module/utils/resolveAudioSource.js.map +1 -0
- package/lib/typescript/core/AudioBuffer.d.ts +12 -0
- package/lib/typescript/core/AudioBuffer.d.ts.map +1 -0
- package/lib/typescript/core/AudioBufferSourceNode.d.ts +12 -0
- package/lib/typescript/core/AudioBufferSourceNode.d.ts.map +1 -0
- package/lib/typescript/core/AudioContext.d.ts +6 -0
- package/lib/typescript/core/AudioContext.d.ts.map +1 -0
- package/lib/typescript/core/AudioDestinationNode.d.ts +7 -0
- package/lib/typescript/core/AudioDestinationNode.d.ts.map +1 -0
- package/lib/typescript/core/AudioNode.d.ts +16 -0
- package/lib/typescript/core/AudioNode.d.ts.map +1 -0
- package/lib/typescript/core/AudioParam.d.ts +14 -0
- package/lib/typescript/core/AudioParam.d.ts.map +1 -0
- package/lib/typescript/core/AudioScheduledSourceNode.d.ts +10 -0
- package/lib/typescript/core/AudioScheduledSourceNode.d.ts.map +1 -0
- package/lib/typescript/core/BaseAudioContext.d.ts +27 -0
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -0
- package/lib/typescript/core/BiquadFilterNode.d.ts +16 -0
- package/lib/typescript/core/BiquadFilterNode.d.ts.map +1 -0
- package/lib/typescript/core/GainNode.d.ts +9 -0
- package/lib/typescript/core/GainNode.d.ts.map +1 -0
- package/lib/typescript/core/OscillatorNode.d.ts +15 -0
- package/lib/typescript/core/OscillatorNode.d.ts.map +1 -0
- package/lib/typescript/core/PeriodicWave.d.ts +5 -0
- package/lib/typescript/core/PeriodicWave.d.ts.map +1 -0
- package/lib/typescript/core/StereoPannerNode.d.ts +9 -0
- package/lib/typescript/core/StereoPannerNode.d.ts.map +1 -0
- package/lib/typescript/core/types.d.ts +15 -0
- package/lib/typescript/core/types.d.ts.map +1 -0
- package/lib/typescript/errors/IndexSizeError.d.ts +5 -0
- package/lib/typescript/errors/IndexSizeError.d.ts.map +1 -0
- package/lib/typescript/errors/InvalidAccessError.d.ts +5 -0
- package/lib/typescript/errors/InvalidAccessError.d.ts.map +1 -0
- package/lib/typescript/errors/InvalidStateError.d.ts +5 -0
- package/lib/typescript/errors/InvalidStateError.d.ts.map +1 -0
- package/lib/typescript/errors/RangeError.d.ts +5 -0
- package/lib/typescript/errors/RangeError.d.ts.map +1 -0
- package/lib/typescript/errors/index.d.ts +5 -0
- package/lib/typescript/errors/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +88 -5
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/index.native.d.ts +14 -0
- package/lib/typescript/index.native.d.ts.map +1 -0
- package/lib/typescript/interfaces.d.ts +79 -0
- package/lib/typescript/interfaces.d.ts.map +1 -0
- package/lib/typescript/utils/resolveAudioSource.d.ts +3 -0
- package/lib/typescript/utils/resolveAudioSource.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/core/AudioBuffer.ts +68 -0
- package/src/core/AudioBufferSourceNode.ts +35 -0
- package/src/core/AudioContext.ts +12 -0
- package/src/core/AudioDestinationNode.ts +9 -0
- package/src/core/AudioNode.ts +38 -0
- package/src/core/AudioParam.ts +55 -0
- package/src/core/AudioScheduledSourceNode.ts +43 -0
- package/src/core/BaseAudioContext.ts +108 -0
- package/src/core/BiquadFilterNode.ts +49 -0
- package/src/core/GainNode.ts +13 -0
- package/src/core/OscillatorNode.ts +37 -0
- package/src/core/PeriodicWave.ts +10 -0
- package/src/core/StereoPannerNode.ts +13 -0
- package/src/core/types.ts +33 -0
- package/src/errors/IndexSizeError.ts +8 -0
- package/src/errors/InvalidAccessError.ts +8 -0
- package/src/errors/InvalidStateError.ts +8 -0
- package/src/errors/RangeError.ts +8 -0
- package/src/errors/index.ts +4 -0
- package/src/index.native.ts +25 -0
- package/src/index.ts +380 -40
- package/src/interfaces.ts +121 -0
- package/src/modules/global.d.ts +3 -3
- package/src/utils/resolveAudioSource.ts +14 -0
- package/lib/module/types.js.map +0 -1
- package/lib/typescript/types.d.ts +0 -76
- package/lib/typescript/types.d.ts.map +0 -1
- package/src/types.ts +0 -108
- /package/lib/module/{types.js → core/types.js} +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2010 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Redistribution and use in source and binary forms, with or without
|
|
5
|
+
* modification, are permitted provided that the following conditions
|
|
6
|
+
* are met:
|
|
7
|
+
*
|
|
8
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
9
|
+
* notice, this list of conditions and the following disclaimer.
|
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
|
13
|
+
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
|
|
14
|
+
* its contributors may be used to endorse or promote products derived
|
|
15
|
+
* from this software without specific prior written permission.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
|
|
18
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
|
21
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
22
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
23
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
24
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
25
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
26
|
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
#pragma once
|
|
30
|
+
|
|
31
|
+
#include <algorithm>
|
|
32
|
+
#include <cmath>
|
|
33
|
+
#include <utility>
|
|
34
|
+
|
|
35
|
+
#include "VectorMath.h"
|
|
36
|
+
|
|
37
|
+
namespace audioapi {
|
|
38
|
+
|
|
39
|
+
class FFTFrame {
|
|
40
|
+
public:
|
|
41
|
+
explicit FFTFrame(int size)
|
|
42
|
+
: size_(size),
|
|
43
|
+
log2Size_(static_cast<int>(log2(size))),
|
|
44
|
+
realData_(new float[size]),
|
|
45
|
+
imaginaryData_(new float[size]) {}
|
|
46
|
+
~FFTFrame() {
|
|
47
|
+
delete[] realData_;
|
|
48
|
+
delete[] imaginaryData_;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[[nodiscard]] float *getRealData() const {
|
|
52
|
+
return realData_;
|
|
53
|
+
}
|
|
54
|
+
[[nodiscard]] float *getImaginaryData() const {
|
|
55
|
+
return imaginaryData_;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void inverse(float *data);
|
|
59
|
+
|
|
60
|
+
private:
|
|
61
|
+
int size_;
|
|
62
|
+
int log2Size_;
|
|
63
|
+
float *realData_;
|
|
64
|
+
float *imaginaryData_;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace audioapi
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#include "JsiPromise.h"
|
|
2
|
+
|
|
3
|
+
#include <jsi/jsi.h>
|
|
4
|
+
#include <ReactCommon/CallInvoker.h>
|
|
5
|
+
#include <functional>
|
|
6
|
+
|
|
7
|
+
namespace JsiPromise {
|
|
8
|
+
|
|
9
|
+
using namespace facebook;
|
|
10
|
+
|
|
11
|
+
jsi::Value PromiseVendor::createPromise(std::function<void(std::shared_ptr<Promise>)> func) {
|
|
12
|
+
if (_runtime == nullptr) {
|
|
13
|
+
throw new std::runtime_error("Runtime was null!");
|
|
14
|
+
}
|
|
15
|
+
auto& runtime = *_runtime;
|
|
16
|
+
auto callInvoker = _callInvoker;
|
|
17
|
+
|
|
18
|
+
// get Promise constructor
|
|
19
|
+
auto promiseCtor = runtime.global().getPropertyAsFunction(runtime, "Promise");
|
|
20
|
+
|
|
21
|
+
// create a "run" function (first Promise arg)
|
|
22
|
+
auto runPromise = jsi::Function::createFromHostFunction(runtime,
|
|
23
|
+
jsi::PropNameID::forUtf8(runtime, "runPromise"),
|
|
24
|
+
2,
|
|
25
|
+
[callInvoker, func](jsi::Runtime& runtime,
|
|
26
|
+
const jsi::Value& thisValue,
|
|
27
|
+
const jsi::Value* arguments,
|
|
28
|
+
size_t count) -> jsi::Value {
|
|
29
|
+
auto resolveLocal = arguments[0].asObject(runtime).asFunction(runtime);
|
|
30
|
+
auto resolve = std::make_shared<jsi::Function>(std::move(resolveLocal));
|
|
31
|
+
auto rejectLocal = arguments[1].asObject(runtime).asFunction(runtime);
|
|
32
|
+
auto reject = std::make_shared<jsi::Function>(std::move(rejectLocal));
|
|
33
|
+
|
|
34
|
+
auto resolveWrapper = [resolve, &runtime, callInvoker](jsi::Value value) -> void {
|
|
35
|
+
auto valueShared = std::make_shared<jsi::Value>(std::move(value));
|
|
36
|
+
callInvoker->invokeAsync([resolve, &runtime, valueShared]() -> void {
|
|
37
|
+
resolve->call(runtime, *valueShared);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
auto rejectWrapper = [reject, &runtime, callInvoker](const std::string& errorMessage) -> void {
|
|
42
|
+
auto error = jsi::JSError(runtime, errorMessage);
|
|
43
|
+
auto errorShared = std::make_shared<jsi::JSError>(error);
|
|
44
|
+
callInvoker->invokeAsync([reject, &runtime, errorShared]() -> void {
|
|
45
|
+
reject->call(runtime, errorShared->value());
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
auto promise = std::make_shared<Promise>(resolveWrapper, rejectWrapper);
|
|
50
|
+
func(promise);
|
|
51
|
+
|
|
52
|
+
return jsi::Value::undefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// return new Promise((resolve, reject) => ...)
|
|
56
|
+
return promiseCtor.callAsConstructor(runtime, runPromise);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
} // namespace JsiPromise
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <ReactCommon/CallInvoker.h>
|
|
4
|
+
#include <jsi/jsi.h>
|
|
5
|
+
#include <utility>
|
|
6
|
+
#include <memory>
|
|
7
|
+
#include <string>
|
|
8
|
+
|
|
9
|
+
namespace JsiPromise {
|
|
10
|
+
|
|
11
|
+
using namespace facebook;
|
|
12
|
+
|
|
13
|
+
class Promise {
|
|
14
|
+
public:
|
|
15
|
+
Promise(std::function<void(jsi::Value)> resolve, std::function<void(const std::string&)> reject): _resolve(std::move(resolve)), _reject(std::move(reject)) {}
|
|
16
|
+
|
|
17
|
+
bool isResolved;
|
|
18
|
+
void resolve(jsi::Value&& value) {
|
|
19
|
+
_resolve(std::forward<jsi::Value>(value));
|
|
20
|
+
}
|
|
21
|
+
void reject(const std::string& errorMessage) {
|
|
22
|
+
_reject(errorMessage);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private:
|
|
26
|
+
std::function<void(jsi::Value)> _resolve;
|
|
27
|
+
std::function<void(const std::string&)> _reject;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
class PromiseVendor {
|
|
31
|
+
public:
|
|
32
|
+
PromiseVendor(jsi::Runtime* runtime, std::shared_ptr<react::CallInvoker> callInvoker): _runtime(runtime), _callInvoker(callInvoker) {}
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
jsi::Value createPromise(std::function<void(std::shared_ptr<Promise>)> func);
|
|
36
|
+
|
|
37
|
+
private:
|
|
38
|
+
jsi::Runtime* _runtime;
|
|
39
|
+
std::shared_ptr<react::CallInvoker> _callInvoker;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace JsiPromise
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <mutex>
|
|
4
|
+
|
|
5
|
+
namespace audioapi {
|
|
6
|
+
|
|
7
|
+
// Small easy interface to manage locking
|
|
8
|
+
class Locker {
|
|
9
|
+
public:
|
|
10
|
+
Locker() : lockPtr_(0) {}
|
|
11
|
+
explicit Locker(std::mutex &lockPtr) : lockPtr_(&lockPtr) {
|
|
12
|
+
lock();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
~Locker() {
|
|
16
|
+
unlock();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
explicit operator bool() const {
|
|
20
|
+
return !!lockPtr_;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
void lock() {
|
|
24
|
+
if (lockPtr_) {
|
|
25
|
+
lockPtr_->lock();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
void unlock() {
|
|
30
|
+
if (lockPtr_) {
|
|
31
|
+
lockPtr_->unlock();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static Locker tryLock(std::mutex &lock) {
|
|
36
|
+
Locker result = Locker();
|
|
37
|
+
|
|
38
|
+
if (lock.try_lock()) {
|
|
39
|
+
result.lockPtr_ = &lock;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private:
|
|
46
|
+
std::mutex *lockPtr_;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} // namespace audioapi
|
|
@@ -77,7 +77,7 @@ void add(
|
|
|
77
77
|
numberOfElementsToProcess);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
void
|
|
80
|
+
void subtract(
|
|
81
81
|
const float *inputVector1,
|
|
82
82
|
const float *inputVector2,
|
|
83
83
|
float *outputVector,
|
|
@@ -115,6 +115,22 @@ float maximumMagnitude(
|
|
|
115
115
|
return maximumValue;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
void multiplyByScalarThenAddToOutput(
|
|
119
|
+
const float *inputVector,
|
|
120
|
+
float scalar,
|
|
121
|
+
float *outputVector,
|
|
122
|
+
size_t numberOfElementsToProcess) {
|
|
123
|
+
vDSP_vsma(
|
|
124
|
+
inputVector,
|
|
125
|
+
1,
|
|
126
|
+
&scalar,
|
|
127
|
+
outputVector,
|
|
128
|
+
1,
|
|
129
|
+
outputVector,
|
|
130
|
+
1,
|
|
131
|
+
numberOfElementsToProcess);
|
|
132
|
+
}
|
|
133
|
+
|
|
118
134
|
#else
|
|
119
135
|
|
|
120
136
|
#if defined(HAVE_X86_SSE2)
|
|
@@ -363,7 +379,7 @@ void add(
|
|
|
363
379
|
}
|
|
364
380
|
}
|
|
365
381
|
|
|
366
|
-
void
|
|
382
|
+
void subtract(
|
|
367
383
|
const float *inputVector1,
|
|
368
384
|
const float *inputVector2,
|
|
369
385
|
float *outputVector,
|
|
@@ -578,7 +594,7 @@ float maximumMagnitude(
|
|
|
578
594
|
max = std::max(max, groupMaxP[3]);
|
|
579
595
|
|
|
580
596
|
n = tailFrames;
|
|
581
|
-
#elif defined(
|
|
597
|
+
#elif defined(c)
|
|
582
598
|
size_t tailFrames = n % 4;
|
|
583
599
|
const float *endP = inputVector + n - tailFrames;
|
|
584
600
|
|
|
@@ -605,5 +621,74 @@ float maximumMagnitude(
|
|
|
605
621
|
return max;
|
|
606
622
|
}
|
|
607
623
|
|
|
624
|
+
void multiplyByScalarThenAddToOutput(
|
|
625
|
+
const float *inputVector,
|
|
626
|
+
float scalar,
|
|
627
|
+
float *outputVector,
|
|
628
|
+
size_t numberOfElementsToProcess) {
|
|
629
|
+
size_t n = numberOfElementsToProcess;
|
|
630
|
+
|
|
631
|
+
#if HAVE_X86_SSE2
|
|
632
|
+
// If the inputVector address is not 16-byte aligned, the first several frames
|
|
633
|
+
// (at most three) should be processed separately.
|
|
634
|
+
while (!is16ByteAligned(inputVector) && n) {
|
|
635
|
+
*outputVector += scalar * *inputVector;
|
|
636
|
+
inputVector++;
|
|
637
|
+
outputVector++;
|
|
638
|
+
n--;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// Now the inputVector is aligned, use SSE.
|
|
642
|
+
size_t tailFrames = n % 4;
|
|
643
|
+
const float *endP = outputVector + n - tailFrames;
|
|
644
|
+
|
|
645
|
+
__m128 pSource;
|
|
646
|
+
__m128 dest;
|
|
647
|
+
__m128 temp;
|
|
648
|
+
__m128 mScale = _mm_set_ps1(scalar);
|
|
649
|
+
|
|
650
|
+
bool destAligned = is16ByteAligned(outputVector);
|
|
651
|
+
|
|
652
|
+
#define SSE2_MULT_ADD(loadInstr, storeInstr) \
|
|
653
|
+
while (outputVector < endP) { \
|
|
654
|
+
pSource = _mm_load_ps(inputVector); \
|
|
655
|
+
temp = _mm_mul_ps(pSource, mScale); \
|
|
656
|
+
dest = _mm_##loadInstr##_ps(outputVector); \
|
|
657
|
+
dest = _mm_add_ps(dest, temp); \
|
|
658
|
+
_mm_##storeInstr##_ps(outputVector, dest); \
|
|
659
|
+
inputVector += 4; \
|
|
660
|
+
outputVector += 4; \
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (destAligned)
|
|
664
|
+
SSE2_MULT_ADD(load, store)
|
|
665
|
+
else
|
|
666
|
+
SSE2_MULT_ADD(loadu, storeu)
|
|
667
|
+
|
|
668
|
+
n = tailFrames;
|
|
669
|
+
#elif HAVE_ARM_NEON_INTRINSICS
|
|
670
|
+
size_t tailFrames = n % 4;
|
|
671
|
+
const float *endP = outputVector + n - tailFrames;
|
|
672
|
+
|
|
673
|
+
float32x4_t k = vdupq_n_f32(scalar);
|
|
674
|
+
while (outputVector < endP) {
|
|
675
|
+
float32x4_t source = vld1q_f32(inputVector);
|
|
676
|
+
float32x4_t dest = vld1q_f32(outputVector);
|
|
677
|
+
|
|
678
|
+
dest = vmlaq_f32(dest, source, k);
|
|
679
|
+
vst1q_f32(outputVector, dest);
|
|
680
|
+
|
|
681
|
+
inputVector += 4;
|
|
682
|
+
outputVector += 4;
|
|
683
|
+
}
|
|
684
|
+
n = tailFrames;
|
|
685
|
+
#endif
|
|
686
|
+
while (n--) {
|
|
687
|
+
*outputVector += *inputVector * scalar;
|
|
688
|
+
++inputVector;
|
|
689
|
+
++outputVector;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
608
693
|
#endif
|
|
609
694
|
} // namespace audioapi::VectorMath
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
|
|
33
33
|
namespace audioapi::VectorMath {
|
|
34
34
|
|
|
35
|
+
void multiplyByScalarThenAddToOutput(
|
|
36
|
+
const float *inputVector,
|
|
37
|
+
float scalar,
|
|
38
|
+
float *outputVector,
|
|
39
|
+
size_t numberOfElementsToProcess);
|
|
40
|
+
|
|
35
41
|
void multiplyByScalar(
|
|
36
42
|
const float *inputVector,
|
|
37
43
|
float scalar,
|
|
@@ -47,7 +53,7 @@ void add(
|
|
|
47
53
|
const float *inputVector2,
|
|
48
54
|
float *outputVector,
|
|
49
55
|
size_t numberOfElementsToProcess);
|
|
50
|
-
void
|
|
56
|
+
void subtract(
|
|
51
57
|
const float *inputVector1,
|
|
52
58
|
const float *inputVector2,
|
|
53
59
|
float *outputVector,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#if defined(ANDROID)
|
|
2
|
+
#include "FFTFrame.h"
|
|
3
|
+
#include <fftw3.h>
|
|
4
|
+
|
|
5
|
+
namespace audioapi {
|
|
6
|
+
void FFTFrame::inverse(float *timeDomainData) {
|
|
7
|
+
fftwf_complex *freqDomainData = fftwf_alloc_complex(size_ / 2);
|
|
8
|
+
for (int i = 0; i < size_ / 2; i++) {
|
|
9
|
+
freqDomainData[i][0] = realData_[i];
|
|
10
|
+
freqDomainData[i][1] = imaginaryData_[i];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
auto plan = fftwf_plan_dft_c2r_1d(
|
|
14
|
+
size_, freqDomainData, timeDomainData, FFTW_ESTIMATE);
|
|
15
|
+
fftwf_execute(plan);
|
|
16
|
+
fftwf_destroy_plan(plan);
|
|
17
|
+
fftwf_free(freqDomainData);
|
|
18
|
+
|
|
19
|
+
VectorMath::multiplyByScalar(
|
|
20
|
+
timeDomainData, 1.0f / static_cast<float>(size_), timeDomainData, size_);
|
|
21
|
+
}
|
|
22
|
+
} // namespace audioapi
|
|
23
|
+
#endif
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#if defined(HAVE_ACCELERATE)
|
|
2
|
+
#include "FFTFrame.h"
|
|
3
|
+
#include "Accelerate/Accelerate.h"
|
|
4
|
+
|
|
5
|
+
namespace audioapi {
|
|
6
|
+
|
|
7
|
+
void FFTFrame::inverse(float *timeDomainData) {
|
|
8
|
+
FFTSetup fftSetup_ = vDSP_create_fftsetup(log2Size_, FFT_RADIX2);
|
|
9
|
+
DSPSplitComplex freqDomainData;
|
|
10
|
+
freqDomainData.realp = realData_;
|
|
11
|
+
freqDomainData.imagp = imaginaryData_;
|
|
12
|
+
|
|
13
|
+
vDSP_fft_zrip(fftSetup_, &freqDomainData, 1, log2Size_, FFT_INVERSE);
|
|
14
|
+
vDSP_ztoc(
|
|
15
|
+
&freqDomainData,
|
|
16
|
+
1,
|
|
17
|
+
reinterpret_cast<DSPComplex *>(timeDomainData),
|
|
18
|
+
2,
|
|
19
|
+
size_ / 2);
|
|
20
|
+
|
|
21
|
+
// Scale the FFT data, beacuse of
|
|
22
|
+
// https://developer.apple.com/library/archive/documentation/Performance/Conceptual/vDSP_Programming_Guide/UsingFourierTransforms/UsingFourierTransforms.html#//apple_ref/doc/uid/TP40005147-CH3-15892
|
|
23
|
+
VectorMath::multiplyByScalar(
|
|
24
|
+
timeDomainData, 1.0f / static_cast<float>(size_), timeDomainData, size_);
|
|
25
|
+
|
|
26
|
+
vDSP_destroy_fftsetup(fftSetup_);
|
|
27
|
+
}
|
|
28
|
+
} // namespace audioapi
|
|
29
|
+
#endif
|
|
@@ -24,12 +24,22 @@ void AudioBufferSourceNodeWrapper::setLoop(bool loop) {
|
|
|
24
24
|
std::shared_ptr<AudioBufferWrapper> AudioBufferSourceNodeWrapper::getBuffer() {
|
|
25
25
|
auto audioBufferSourceNode = getAudioBufferSourceNodeFromAudioNode();
|
|
26
26
|
auto buffer = audioBufferSourceNode->getBuffer();
|
|
27
|
+
|
|
28
|
+
if (!buffer) {
|
|
29
|
+
return {nullptr};
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
return std::make_shared<AudioBufferWrapper>(buffer);
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
void AudioBufferSourceNodeWrapper::setBuffer(
|
|
31
36
|
const std::shared_ptr<AudioBufferWrapper> &buffer) {
|
|
32
37
|
auto audioBufferSourceNode = getAudioBufferSourceNodeFromAudioNode();
|
|
38
|
+
if (!buffer) {
|
|
39
|
+
audioBufferSourceNode->setBuffer(std::shared_ptr<AudioBuffer>(nullptr));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
audioBufferSourceNode->setBuffer(buffer->audioBuffer_);
|
|
34
44
|
}
|
|
35
45
|
} // namespace audioapi
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
|
+
#include <optional>
|
|
4
5
|
|
|
5
6
|
#include "AudioBufferSourceNode.h"
|
|
6
7
|
#include "AudioBufferWrapper.h"
|
|
@@ -14,8 +15,8 @@ class AudioBufferSourceNodeWrapper : public AudioScheduledSourceNodeWrapper {
|
|
|
14
15
|
const std::shared_ptr<AudioBufferSourceNode> &audioBufferSourceNode);
|
|
15
16
|
|
|
16
17
|
void setLoop(bool loop);
|
|
17
|
-
bool getLoop();
|
|
18
|
-
std::shared_ptr<AudioBufferWrapper> getBuffer();
|
|
18
|
+
[[nodiscard]] bool getLoop();
|
|
19
|
+
[[nodiscard]] std::shared_ptr<AudioBufferWrapper> getBuffer();
|
|
19
20
|
void setBuffer(const std::shared_ptr<AudioBufferWrapper> &buffer);
|
|
20
21
|
|
|
21
22
|
private:
|
|
@@ -11,11 +11,11 @@ class AudioBufferWrapper {
|
|
|
11
11
|
explicit AudioBufferWrapper(const std::shared_ptr<AudioBuffer> &audioBuffer);
|
|
12
12
|
|
|
13
13
|
std::shared_ptr<AudioBuffer> audioBuffer_;
|
|
14
|
-
int getNumberOfChannels() const;
|
|
15
|
-
int getLength() const;
|
|
16
|
-
double getDuration() const;
|
|
17
|
-
int getSampleRate() const;
|
|
18
|
-
float *getChannelData(int channel) const;
|
|
14
|
+
[[nodiscard]] int getNumberOfChannels() const;
|
|
15
|
+
[[nodiscard]] int getLength() const;
|
|
16
|
+
[[nodiscard]] double getDuration() const;
|
|
17
|
+
[[nodiscard]] int getSampleRate() const;
|
|
18
|
+
[[nodiscard]] float *getChannelData(int channel) const;
|
|
19
19
|
void copyFromChannel(
|
|
20
20
|
float *destination,
|
|
21
21
|
int destinationLength,
|
|
@@ -3,68 +3,15 @@
|
|
|
3
3
|
namespace audioapi {
|
|
4
4
|
|
|
5
5
|
AudioContextWrapper::AudioContextWrapper(
|
|
6
|
-
const std::shared_ptr<AudioContext> &
|
|
7
|
-
:
|
|
8
|
-
auto destination = audioContext_->getDestination();
|
|
9
|
-
destination_ = std::make_shared<AudioDestinationNodeWrapper>(destination);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
std::shared_ptr<AudioDestinationNodeWrapper>
|
|
13
|
-
AudioContextWrapper::getDestination() const {
|
|
14
|
-
return destination_;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
std::shared_ptr<OscillatorNodeWrapper> AudioContextWrapper::createOscillator()
|
|
18
|
-
const {
|
|
19
|
-
auto oscillator = audioContext_->createOscillator();
|
|
20
|
-
return std::make_shared<OscillatorNodeWrapper>(oscillator);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
std::shared_ptr<GainNodeWrapper> AudioContextWrapper::createGain() const {
|
|
24
|
-
auto gain = audioContext_->createGain();
|
|
25
|
-
return std::make_shared<GainNodeWrapper>(gain);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
std::shared_ptr<StereoPannerNodeWrapper>
|
|
29
|
-
AudioContextWrapper::createStereoPanner() const {
|
|
30
|
-
auto panner = audioContext_->createStereoPanner();
|
|
31
|
-
return std::make_shared<StereoPannerNodeWrapper>(panner);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
std::shared_ptr<BiquadFilterNodeWrapper>
|
|
35
|
-
AudioContextWrapper::createBiquadFilter() const {
|
|
36
|
-
auto filter = audioContext_->createBiquadFilter();
|
|
37
|
-
return std::make_shared<BiquadFilterNodeWrapper>(filter);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
std::shared_ptr<AudioBufferSourceNodeWrapper>
|
|
41
|
-
AudioContextWrapper::createBufferSource() const {
|
|
42
|
-
auto bufferSource = audioContext_->createBufferSource();
|
|
43
|
-
return std::make_shared<AudioBufferSourceNodeWrapper>(bufferSource);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
std::shared_ptr<AudioBufferWrapper> AudioContextWrapper::createBuffer(
|
|
47
|
-
int numberOfChannels,
|
|
48
|
-
int length,
|
|
49
|
-
int sampleRate) const {
|
|
50
|
-
auto buffer =
|
|
51
|
-
audioContext_->createBuffer(numberOfChannels, length, sampleRate);
|
|
52
|
-
return std::make_shared<AudioBufferWrapper>(buffer);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
std::string AudioContextWrapper::getState() const {
|
|
56
|
-
return audioContext_->getState();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
int AudioContextWrapper::getSampleRate() const {
|
|
60
|
-
return audioContext_->getSampleRate();
|
|
61
|
-
}
|
|
6
|
+
const std::shared_ptr<AudioContext> &context)
|
|
7
|
+
: BaseAudioContextWrapper(context) {}
|
|
62
8
|
|
|
63
|
-
|
|
64
|
-
|
|
9
|
+
void AudioContextWrapper::close() {
|
|
10
|
+
getAudioContextFromBaseAudioContext()->close();
|
|
65
11
|
}
|
|
66
12
|
|
|
67
|
-
|
|
68
|
-
|
|
13
|
+
std::shared_ptr<AudioContext>
|
|
14
|
+
AudioContextWrapper::getAudioContextFromBaseAudioContext() {
|
|
15
|
+
return std::static_pointer_cast<AudioContext>(context_);
|
|
69
16
|
}
|
|
70
17
|
} // namespace audioapi
|
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
|
-
#include <string>
|
|
5
|
-
#include <utility>
|
|
6
4
|
|
|
7
|
-
#include "AudioBufferSourceNodeWrapper.h"
|
|
8
|
-
#include "AudioBufferWrapper.h"
|
|
9
5
|
#include "AudioContext.h"
|
|
10
|
-
#include "
|
|
11
|
-
#include "BiquadFilterNodeWrapper.h"
|
|
12
|
-
#include "GainNodeWrapper.h"
|
|
13
|
-
#include "OscillatorNodeWrapper.h"
|
|
14
|
-
#include "StereoPannerNodeWrapper.h"
|
|
6
|
+
#include "BaseAudioContextWrapper.h"
|
|
15
7
|
|
|
16
8
|
namespace audioapi {
|
|
17
9
|
|
|
18
|
-
class AudioContextWrapper {
|
|
10
|
+
class AudioContextWrapper : public BaseAudioContextWrapper {
|
|
19
11
|
public:
|
|
20
|
-
explicit AudioContextWrapper(
|
|
21
|
-
const std::shared_ptr<AudioContext> &audiocontext);
|
|
12
|
+
explicit AudioContextWrapper(const std::shared_ptr<AudioContext> &context);
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
std::shared_ptr<OscillatorNodeWrapper> createOscillator() const;
|
|
25
|
-
std::shared_ptr<GainNodeWrapper> createGain() const;
|
|
26
|
-
std::shared_ptr<StereoPannerNodeWrapper> createStereoPanner() const;
|
|
27
|
-
std::shared_ptr<BiquadFilterNodeWrapper> createBiquadFilter() const;
|
|
28
|
-
std::shared_ptr<AudioBufferSourceNodeWrapper> createBufferSource() const;
|
|
29
|
-
std::shared_ptr<AudioBufferWrapper>
|
|
30
|
-
createBuffer(int numberOfChannels, int length, int sampleRate) const;
|
|
31
|
-
std::string getState() const;
|
|
32
|
-
int getSampleRate() const;
|
|
33
|
-
double getCurrentTime() const;
|
|
34
|
-
void close() const;
|
|
14
|
+
void close();
|
|
35
15
|
|
|
36
16
|
private:
|
|
37
|
-
std::shared_ptr<
|
|
38
|
-
std::shared_ptr<AudioContext> audioContext_;
|
|
17
|
+
std::shared_ptr<AudioContext> getAudioContextFromBaseAudioContext();
|
|
39
18
|
};
|
|
40
19
|
} // namespace audioapi
|
|
@@ -11,11 +11,11 @@ class AudioNodeWrapper {
|
|
|
11
11
|
public:
|
|
12
12
|
explicit AudioNodeWrapper(const std::shared_ptr<AudioNode> &node);
|
|
13
13
|
|
|
14
|
-
int getNumberOfInputs() const;
|
|
15
|
-
int getNumberOfOutputs() const;
|
|
16
|
-
int getChannelCount() const;
|
|
17
|
-
std::string getChannelCountMode() const;
|
|
18
|
-
std::string getChannelInterpretation() const;
|
|
14
|
+
[[nodiscard]] int getNumberOfInputs() const;
|
|
15
|
+
[[nodiscard]] int getNumberOfOutputs() const;
|
|
16
|
+
[[nodiscard]] int getChannelCount() const;
|
|
17
|
+
[[nodiscard]] std::string getChannelCountMode() const;
|
|
18
|
+
[[nodiscard]] std::string getChannelInterpretation() const;
|
|
19
19
|
void connect(const std::shared_ptr<AudioNodeWrapper> &node) const;
|
|
20
20
|
void disconnect(const std::shared_ptr<AudioNodeWrapper> &node) const;
|
|
21
21
|
|
|
@@ -10,11 +10,11 @@ class AudioParamWrapper {
|
|
|
10
10
|
public:
|
|
11
11
|
explicit AudioParamWrapper(const std::shared_ptr<AudioParam> ¶m);
|
|
12
12
|
|
|
13
|
-
float getValue() const;
|
|
13
|
+
[[nodiscard]] float getValue() const;
|
|
14
14
|
void setValue(float value) const;
|
|
15
|
-
float getDefaultValue() const;
|
|
16
|
-
float getMinValue() const;
|
|
17
|
-
float getMaxValue() const;
|
|
15
|
+
[[nodiscard]] float getDefaultValue() const;
|
|
16
|
+
[[nodiscard]] float getMinValue() const;
|
|
17
|
+
[[nodiscard]] float getMaxValue() const;
|
|
18
18
|
void setValueAtTime(float value, double startTime) const;
|
|
19
19
|
void linearRampToValueAtTime(float value, double endTime) const;
|
|
20
20
|
void exponentialRampToValueAtTime(float value, double endTime) const;
|