react-native-audio-api 0.3.1 → 0.3.2
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 +40 -29
- package/android/CMakeLists.txt +17 -21
- package/android/build.gradle +26 -9
- package/android/src/main/cpp/OnLoad.cpp +1 -1
- package/android/src/main/cpp/core/AudioAPIInstaller.cpp +37 -0
- package/android/src/main/cpp/{AudioAPIInstaller → core}/AudioAPIInstaller.h +4 -13
- package/android/src/main/cpp/{AudioDecoder → core}/AudioDecoder.cpp +0 -8
- package/android/src/main/java/com/swmansion/audioapi/AudioAPIPackage.kt +2 -0
- package/android/src/main/java/com/swmansion/audioapi/nativemodules/AudioAPIModule.kt +6 -4
- package/common/cpp/HostObjects/AudioParamHostObject.h +39 -2
- package/common/cpp/core/AudioBufferSourceNode.cpp +4 -3
- package/{android/src/main/cpp/AudioDecoder → common/cpp/core}/AudioDecoder.h +1 -3
- package/common/cpp/core/AudioParam.cpp +218 -58
- package/common/cpp/core/AudioParam.h +19 -15
- package/common/cpp/core/AudioScheduledSourceNode.cpp +9 -1
- package/common/cpp/core/AudioScheduledSourceNode.h +4 -1
- package/common/cpp/core/BaseAudioContext.cpp +3 -13
- package/common/cpp/core/BaseAudioContext.h +2 -4
- package/common/cpp/core/BiquadFilterNode.cpp +5 -7
- package/common/cpp/{HostObjects → core}/Constants.h +2 -4
- package/common/cpp/core/GainNode.cpp +1 -1
- package/common/cpp/core/OscillatorNode.cpp +4 -3
- package/common/cpp/core/ParamChangeEvent.cpp +58 -0
- package/common/cpp/core/{ParamChange.h → ParamChangeEvent.h} +11 -5
- package/common/cpp/core/StereoPannerNode.cpp +1 -1
- package/common/cpp/jsi/JsiHostObject.cpp +35 -30
- package/common/cpp/jsi/JsiHostObject.h +12 -6
- package/common/cpp/jsi/RuntimeAwareCache.h +57 -0
- package/common/cpp/jsi/RuntimeLifecycleMonitor.cpp +61 -0
- package/common/cpp/jsi/RuntimeLifecycleMonitor.h +32 -0
- package/common/cpp/types/BiquadFilterType.h +0 -4
- package/common/cpp/types/ChannelCountMode.h +0 -3
- package/common/cpp/types/ChannelInterpretation.h +0 -3
- package/common/cpp/types/ContextState.h +0 -3
- package/common/cpp/types/OscillatorType.h +0 -4
- package/common/cpp/types/ParamChangeEventType.h +13 -0
- package/common/cpp/utils/AudioUtils.h +1 -5
- package/common/cpp/utils/{ios/FFTFrame.cpp → FFTFrame.cpp} +30 -3
- package/common/cpp/utils/VectorMath.h +7 -33
- package/ios/AudioAPIModule.h +4 -12
- package/ios/AudioAPIModule.mm +25 -20
- package/ios/core/AudioDecoder.mm +45 -0
- package/lib/module/core/AudioBuffer.js +3 -1
- package/lib/module/core/AudioBuffer.js.map +1 -1
- package/lib/module/core/AudioBufferSourceNode.js +5 -3
- package/lib/module/core/AudioBufferSourceNode.js.map +1 -1
- package/lib/module/core/AudioContext.js +3 -1
- package/lib/module/core/AudioContext.js.map +1 -1
- package/lib/module/core/AudioDestinationNode.js +4 -6
- package/lib/module/core/AudioDestinationNode.js.map +1 -1
- package/lib/module/core/AudioNode.js +3 -1
- package/lib/module/core/AudioNode.js.map +1 -1
- package/lib/module/core/AudioParam.js +27 -1
- package/lib/module/core/AudioParam.js.map +1 -1
- package/lib/module/core/AudioScheduledSourceNode.js +4 -5
- package/lib/module/core/AudioScheduledSourceNode.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +11 -9
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/BiquadFilterNode.js +5 -3
- package/lib/module/core/BiquadFilterNode.js.map +1 -1
- package/lib/module/core/GainNode.js +4 -2
- package/lib/module/core/GainNode.js.map +1 -1
- package/lib/module/core/OscillatorNode.js +5 -3
- package/lib/module/core/OscillatorNode.js.map +1 -1
- package/lib/module/core/PeriodicWave.js +2 -0
- package/lib/module/core/PeriodicWave.js.map +1 -1
- package/lib/module/core/StereoPannerNode.js +4 -2
- package/lib/module/core/StereoPannerNode.js.map +1 -1
- package/lib/module/core/types.js +1 -1
- package/lib/module/errors/IndexSizeError.js +2 -0
- package/lib/module/errors/IndexSizeError.js.map +1 -1
- package/lib/module/errors/InvalidAccessError.js +2 -0
- package/lib/module/errors/InvalidAccessError.js.map +1 -1
- package/lib/module/errors/InvalidStateError.js +2 -0
- package/lib/module/errors/InvalidStateError.js.map +1 -1
- package/lib/module/errors/RangeError.js +2 -0
- package/lib/module/errors/RangeError.js.map +1 -1
- package/lib/module/errors/index.js +6 -4
- package/lib/module/errors/index.js.map +1 -1
- package/lib/module/index.js +18 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +16 -14
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/interfaces.js +2 -0
- package/lib/module/specs/global.d.js +4 -0
- package/lib/module/{modules → specs}/global.d.js.map +1 -1
- package/lib/module/{utils → specs}/install.js +5 -9
- package/lib/module/specs/install.js.map +1 -0
- package/lib/typescript/core/AudioBuffer.d.ts +2 -0
- package/lib/typescript/core/AudioBuffer.d.ts.map +1 -1
- package/lib/typescript/core/AudioDestinationNode.d.ts +0 -3
- package/lib/typescript/core/AudioDestinationNode.d.ts.map +1 -1
- package/lib/typescript/core/AudioParam.d.ts +4 -0
- package/lib/typescript/core/AudioParam.d.ts.map +1 -1
- package/lib/typescript/core/AudioScheduledSourceNode.d.ts +0 -3
- package/lib/typescript/core/AudioScheduledSourceNode.d.ts.map +1 -1
- package/lib/typescript/core/PeriodicWave.d.ts +2 -0
- package/lib/typescript/core/PeriodicWave.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +9 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/interfaces.d.ts +4 -0
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/lib/typescript/{utils → specs}/install.d.ts.map +1 -1
- package/metro-config/index.d.ts +5 -0
- package/metro-config/index.js +41 -0
- package/metro-config/tsconfig.json +3 -0
- package/package.json +50 -16
- package/scripts/audioapi_utils.rb +56 -0
- package/src/core/AudioDestinationNode.ts +1 -7
- package/src/core/AudioParam.ts +48 -0
- package/src/core/AudioScheduledSourceNode.ts +0 -5
- package/src/index.native.ts +1 -1
- package/src/index.ts +31 -14
- package/src/interfaces.ts +12 -0
- package/src/{modules → specs}/global.d.ts +2 -0
- package/src/{utils → specs}/install.ts +4 -11
- package/android/src/main/cpp/AudioAPIInstaller/AudioAPIInstaller.cpp +0 -20
- package/common/cpp/core/ParamChange.cpp +0 -46
- package/common/cpp/utils/android/FFTFrame.cpp +0 -23
- package/ios/AudioDecoder/AudioDecoder.h +0 -17
- package/ios/AudioDecoder/AudioDecoder.m +0 -79
- package/ios/AudioDecoder/IOSAudioDecoder.h +0 -28
- package/ios/AudioDecoder/IOSAudioDecoder.mm +0 -46
- package/lib/module/modules/global.d.js +0 -2
- package/lib/module/utils/install.js.map +0 -1
- /package/android/src/main/cpp/{AudioPlayer → core}/AudioPlayer.cpp +0 -0
- /package/android/src/main/cpp/{AudioPlayer → core}/AudioPlayer.h +0 -0
- /package/common/cpp/{AudioAPIInstaller → HostObjects}/AudioAPIInstallerHostObject.h +0 -0
- /package/{android/libs/include → common/cpp/libs}/miniaudio.h +0 -0
- /package/ios/{AudioPlayer → core}/AudioPlayer.h +0 -0
- /package/ios/{AudioPlayer → core}/AudioPlayer.m +0 -0
- /package/ios/{AudioPlayer → core}/IOSAudioPlayer.h +0 -0
- /package/ios/{AudioPlayer → core}/IOSAudioPlayer.mm +0 -0
- /package/lib/typescript/{utils → specs}/install.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-var */
|
|
1
2
|
import type { IAudioContext } from '../interfaces';
|
|
2
3
|
|
|
3
4
|
type AudioAPIInstaller = {
|
|
@@ -8,3 +9,4 @@ declare global {
|
|
|
8
9
|
function nativeCallSyncHook(): unknown;
|
|
9
10
|
var __AudioAPIInstaller: AudioAPIInstaller;
|
|
10
11
|
}
|
|
12
|
+
/* eslint-disable no-var */
|
|
@@ -6,7 +6,7 @@ interface AudioAPIModuleSpec extends TurboModule {
|
|
|
6
6
|
|
|
7
7
|
export function installModule() {
|
|
8
8
|
const AudioAPIModule =
|
|
9
|
-
TurboModuleRegistry.
|
|
9
|
+
TurboModuleRegistry.get<AudioAPIModuleSpec>('AudioAPIModule');
|
|
10
10
|
|
|
11
11
|
if (AudioAPIModule == null) {
|
|
12
12
|
throw new Error(
|
|
@@ -14,26 +14,19 @@ export function installModule() {
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
verifyInstallation();
|
|
19
|
-
|
|
20
|
-
return AudioAPIModule;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function runInstall(Module: any) {
|
|
24
|
-
const result = Module.install();
|
|
17
|
+
const result = AudioAPIModule.install();
|
|
25
18
|
|
|
26
19
|
if (result !== true) {
|
|
27
20
|
throw new Error(
|
|
28
21
|
`Failed to install react-native-audio-api: The native Audio API Module could not be installed! Looks like something went wrong when installing JSI bindings: ${result}`
|
|
29
22
|
);
|
|
30
23
|
}
|
|
31
|
-
}
|
|
32
24
|
|
|
33
|
-
function verifyInstallation() {
|
|
34
25
|
if (global.__AudioAPIInstaller == null) {
|
|
35
26
|
throw new Error(
|
|
36
27
|
'Failed to install react-native-audio-api, the native initializer private does not exist. Are you trying to use Audio API from different JS Runtimes?'
|
|
37
28
|
);
|
|
38
29
|
}
|
|
30
|
+
|
|
31
|
+
return AudioAPIModule;
|
|
39
32
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#include "AudioAPIInstaller.h"
|
|
2
|
-
|
|
3
|
-
namespace audioapi {
|
|
4
|
-
|
|
5
|
-
using namespace facebook::jni;
|
|
6
|
-
|
|
7
|
-
AudioAPIInstaller::AudioAPIInstaller(
|
|
8
|
-
jni::alias_ref<AudioAPIInstaller::jhybridobject> &jThis,
|
|
9
|
-
jsi::Runtime *rnRuntime,
|
|
10
|
-
const std::shared_ptr<facebook::react::CallInvoker> &jsCallInvoker)
|
|
11
|
-
: javaPart_(make_global(jThis)),
|
|
12
|
-
rnRuntime_(rnRuntime),
|
|
13
|
-
jsCallInvoker_(jsCallInvoker) {}
|
|
14
|
-
|
|
15
|
-
void AudioAPIInstaller::install() {
|
|
16
|
-
auto hostObject =
|
|
17
|
-
std::make_shared<AudioAPIInstallerHostObject>(rnRuntime_, jsCallInvoker_);
|
|
18
|
-
hostObject->install();
|
|
19
|
-
}
|
|
20
|
-
} // namespace audioapi
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#include "ParamChange.h"
|
|
2
|
-
|
|
3
|
-
#include <utility>
|
|
4
|
-
|
|
5
|
-
namespace audioapi {
|
|
6
|
-
|
|
7
|
-
ParamChange::ParamChange(
|
|
8
|
-
double startTime,
|
|
9
|
-
double endTime,
|
|
10
|
-
float startValue,
|
|
11
|
-
float endValue,
|
|
12
|
-
std::function<float(double, double, float, float, double)> calculateValue)
|
|
13
|
-
: startTime_(startTime),
|
|
14
|
-
endTime_(endTime),
|
|
15
|
-
startValue_(startValue),
|
|
16
|
-
endValue_(endValue),
|
|
17
|
-
calculateValue_(std::move(calculateValue)) {}
|
|
18
|
-
|
|
19
|
-
double ParamChange::getEndTime() const {
|
|
20
|
-
return endTime_;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
double ParamChange::getStartTime() const {
|
|
24
|
-
return startTime_;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
float ParamChange::getEndValue() const {
|
|
28
|
-
return endValue_;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
float ParamChange::getStartValue() const {
|
|
32
|
-
return startValue_;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
std::function<float(double, double, float, float, double)>
|
|
36
|
-
ParamChange::getCalculateValue() const {
|
|
37
|
-
return calculateValue_;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
bool ParamChange::operator<(const ParamChange &other) const {
|
|
41
|
-
if (startTime_ != other.startTime_)
|
|
42
|
-
return startTime_ < other.startTime_;
|
|
43
|
-
return endTime_ < other.endTime_;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
} // namespace audioapi
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#import <AVFoundation/AVFoundation.h>
|
|
4
|
-
#import <Foundation/Foundation.h>
|
|
5
|
-
|
|
6
|
-
@interface AudioDecoder : NSObject
|
|
7
|
-
|
|
8
|
-
@property (nonatomic, strong) AVAudioPCMBuffer *buffer;
|
|
9
|
-
@property (nonatomic, assign) int sampleRate;
|
|
10
|
-
|
|
11
|
-
- (instancetype)initWithSampleRate:(int)sampleRate;
|
|
12
|
-
|
|
13
|
-
- (const AudioBufferList *)decodeWithFile:(NSString *)path;
|
|
14
|
-
|
|
15
|
-
- (void)cleanup;
|
|
16
|
-
|
|
17
|
-
@end
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
#import <AudioDecoder.h>
|
|
2
|
-
|
|
3
|
-
@implementation AudioDecoder
|
|
4
|
-
|
|
5
|
-
- (instancetype)initWithSampleRate:(int)sampleRate
|
|
6
|
-
{
|
|
7
|
-
if (self = [super init]) {
|
|
8
|
-
self.sampleRate = sampleRate;
|
|
9
|
-
}
|
|
10
|
-
return self;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
- (const AudioBufferList *)decodeWithFile:(NSString *)path
|
|
14
|
-
{
|
|
15
|
-
NSError *error = nil;
|
|
16
|
-
NSURL *fileURL = [NSURL fileURLWithPath:path];
|
|
17
|
-
AVAudioFile *audioFile = [[AVAudioFile alloc] initForReading:fileURL error:&error];
|
|
18
|
-
|
|
19
|
-
if (error) {
|
|
20
|
-
NSLog(@"Error occurred while opening the audio file: %@", [error localizedDescription]);
|
|
21
|
-
return nil;
|
|
22
|
-
}
|
|
23
|
-
AVAudioPCMBuffer *buffer = [[AVAudioPCMBuffer alloc] initWithPCMFormat:[audioFile processingFormat]
|
|
24
|
-
frameCapacity:[audioFile length]];
|
|
25
|
-
|
|
26
|
-
AVAudioFormat *format = [[AVAudioFormat alloc] initWithCommonFormat:AVAudioPCMFormatFloat32
|
|
27
|
-
sampleRate:self.sampleRate
|
|
28
|
-
channels:buffer.audioBufferList->mNumberBuffers
|
|
29
|
-
interleaved:NO];
|
|
30
|
-
|
|
31
|
-
[audioFile readIntoBuffer:buffer error:&error];
|
|
32
|
-
if (error) {
|
|
33
|
-
NSLog(@"Error occurred while reading the audio file: %@", [error localizedDescription]);
|
|
34
|
-
return nil;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (self.sampleRate != audioFile.processingFormat.sampleRate) {
|
|
38
|
-
self.buffer = [self convertBuffer:buffer ToFormat:format];
|
|
39
|
-
} else {
|
|
40
|
-
self.buffer = buffer;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return self.buffer.audioBufferList;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
- (AVAudioPCMBuffer *)convertBuffer:(AVAudioPCMBuffer *)buffer ToFormat:(AVAudioFormat *)format
|
|
47
|
-
{
|
|
48
|
-
NSError *error = nil;
|
|
49
|
-
AVAudioConverter *converter = [[AVAudioConverter alloc] initFromFormat:buffer.format toFormat:format];
|
|
50
|
-
AVAudioPCMBuffer *convertedBuffer =
|
|
51
|
-
[[AVAudioPCMBuffer alloc] initWithPCMFormat:format frameCapacity:(AVAudioFrameCount)buffer.frameCapacity];
|
|
52
|
-
|
|
53
|
-
AVAudioConverterInputBlock inputBlock =
|
|
54
|
-
^AVAudioBuffer *(AVAudioPacketCount inNumberOfPackets, AVAudioConverterInputStatus *outStatus) {
|
|
55
|
-
if (buffer.frameLength > 0) {
|
|
56
|
-
*outStatus = AVAudioConverterInputStatus_HaveData;
|
|
57
|
-
return buffer;
|
|
58
|
-
} else {
|
|
59
|
-
*outStatus = AVAudioConverterInputStatus_NoDataNow;
|
|
60
|
-
return nil;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
[converter convertToBuffer:convertedBuffer error:&error withInputFromBlock:inputBlock];
|
|
65
|
-
|
|
66
|
-
if (error) {
|
|
67
|
-
NSLog(@"Error occurred while converting the audio file: %@", [error localizedDescription]);
|
|
68
|
-
return nil;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return convertedBuffer;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
- (void)cleanup
|
|
75
|
-
{
|
|
76
|
-
self.buffer = nil;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#include <string>
|
|
4
|
-
|
|
5
|
-
#ifdef __OBJC__ // when compiled as Objective-C++
|
|
6
|
-
#import <AudioDecoder.h>
|
|
7
|
-
#else // when compiled as C++
|
|
8
|
-
typedef struct objc_object AudioDecoder;
|
|
9
|
-
#endif // __OBJC__
|
|
10
|
-
|
|
11
|
-
namespace audioapi {
|
|
12
|
-
|
|
13
|
-
class AudioBus;
|
|
14
|
-
|
|
15
|
-
class IOSAudioDecoder {
|
|
16
|
-
protected:
|
|
17
|
-
AudioDecoder *audioDecoder_;
|
|
18
|
-
int sampleRate_;
|
|
19
|
-
|
|
20
|
-
public:
|
|
21
|
-
IOSAudioDecoder(int sampleRate);
|
|
22
|
-
~IOSAudioDecoder();
|
|
23
|
-
|
|
24
|
-
AudioBus *decodeWithFilePath(const std::string &path);
|
|
25
|
-
// TODO: implement this
|
|
26
|
-
AudioBus *decodeWithArrayBuffer();
|
|
27
|
-
};
|
|
28
|
-
} // namespace audioapi
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#import <AVFoundation/AVFoundation.h>
|
|
2
|
-
|
|
3
|
-
#include <AudioArray.h>
|
|
4
|
-
#include <AudioBus.h>
|
|
5
|
-
#include <IOSAudioDecoder.h>
|
|
6
|
-
|
|
7
|
-
namespace audioapi {
|
|
8
|
-
|
|
9
|
-
IOSAudioDecoder::IOSAudioDecoder(int sampleRate) : sampleRate_(sampleRate)
|
|
10
|
-
{
|
|
11
|
-
audioDecoder_ = [[AudioDecoder alloc] initWithSampleRate:sampleRate_];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
IOSAudioDecoder::~IOSAudioDecoder()
|
|
15
|
-
{
|
|
16
|
-
[audioDecoder_ cleanup];
|
|
17
|
-
audioDecoder_ = nullptr;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
AudioBus *IOSAudioDecoder::decodeWithFilePath(const std::string &path)
|
|
21
|
-
{
|
|
22
|
-
auto bufferList = [audioDecoder_ decodeWithFile:[NSString stringWithUTF8String:path.c_str()]];
|
|
23
|
-
AudioBus *audioBus;
|
|
24
|
-
if (bufferList) {
|
|
25
|
-
auto numberOfChannels = bufferList->mNumberBuffers;
|
|
26
|
-
auto size = bufferList->mBuffers[0].mDataByteSize / sizeof(float);
|
|
27
|
-
|
|
28
|
-
audioBus = new AudioBus(sampleRate_, size, numberOfChannels);
|
|
29
|
-
|
|
30
|
-
for (int i = 0; i < numberOfChannels; i++) {
|
|
31
|
-
float *data = (float *)bufferList->mBuffers[i].mData;
|
|
32
|
-
memcpy(audioBus->getChannel(i)->getData(), data, sizeof(float) * size);
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
audioBus = new AudioBus(sampleRate_, 1, 1);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return audioBus;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
AudioBus *IOSAudioDecoder::decodeWithArrayBuffer()
|
|
42
|
-
{
|
|
43
|
-
// TODO: implement his
|
|
44
|
-
return new AudioBus(sampleRate_, 1, 1);
|
|
45
|
-
}
|
|
46
|
-
} // namespace audioapi
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","installModule","AudioAPIModule","getEnforcing","Error","runInstall","verifyInstallation","Module","result","install","global","__AudioAPIInstaller"],"sourceRoot":"../../../src","sources":["utils/install.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAqB,cAAc;AAM/D,OAAO,SAASC,aAAaA,CAAA,EAAG;EAC9B,MAAMC,cAAc,GAClBF,mBAAmB,CAACG,YAAY,CAAqB,gBAAgB,CAAC;EAExE,IAAID,cAAc,IAAI,IAAI,EAAE;IAC1B,MAAM,IAAIE,KAAK,CACb,iFACF,CAAC;EACH;EAEAC,UAAU,CAACH,cAAc,CAAC;EAC1BI,kBAAkB,CAAC,CAAC;EAEpB,OAAOJ,cAAc;AACvB;AAEA,SAASG,UAAUA,CAACE,MAAW,EAAE;EAC/B,MAAMC,MAAM,GAAGD,MAAM,CAACE,OAAO,CAAC,CAAC;EAE/B,IAAID,MAAM,KAAK,IAAI,EAAE;IACnB,MAAM,IAAIJ,KAAK,CACb,+JAA+JI,MAAM,EACvK,CAAC;EACH;AACF;AAEA,SAASF,kBAAkBA,CAAA,EAAG;EAC5B,IAAII,MAAM,CAACC,mBAAmB,IAAI,IAAI,EAAE;IACtC,MAAM,IAAIP,KAAK,CACb,sJACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|