react-native-audio-api 0.5.7 → 0.6.0-rc.1
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 +1 -1
- package/android/CMakeLists.txt +6 -3
- package/android/build.gradle +1 -0
- package/android/src/main/cpp/audioapi/android/core/AudioPlayer.cpp +0 -20
- package/android/src/main/cpp/audioapi/android/core/AudioPlayer.h +0 -2
- package/android/src/main/java/com/swmansion/audioapi/AudioAPIPackage.kt +13 -0
- package/android/src/main/java/com/swmansion/audioapi/AudioManagerModule.kt +62 -0
- package/android/src/main/java/com/swmansion/audioapi/system/AudioFocusListener.kt +60 -0
- package/android/src/main/java/com/swmansion/audioapi/system/LockScreenManager.kt +294 -0
- package/android/src/main/java/com/swmansion/audioapi/system/MediaNotificationManager.kt +279 -0
- package/android/src/main/java/com/swmansion/audioapi/system/MediaReceiver.kt +46 -0
- package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionCallback.kt +39 -0
- package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionEventEmitter.kt +84 -0
- package/android/src/main/java/com/swmansion/audioapi/system/MediaSessionManager.kt +144 -0
- package/android/src/main/res/drawable/next.xml +9 -0
- package/android/src/main/res/drawable/pause.xml +9 -0
- package/android/src/main/res/drawable/play.xml +9 -0
- package/android/src/main/res/drawable/previous.xml +9 -0
- package/android/src/main/res/drawable/skip_backward_5.xml +9 -0
- package/android/src/main/res/drawable/skip_forward_5.xml +9 -0
- package/android/src/main/res/drawable/stop.xml +9 -0
- package/android/src/oldarch/NativeAudioManagerModuleSpec.java +99 -0
- package/app.plugin.js +1 -0
- package/common/cpp/audioapi/AudioAPIModuleInstaller.h +2 -6
- package/common/cpp/audioapi/core/AudioContext.cpp +1 -12
- package/common/cpp/audioapi/core/AudioContext.h +0 -1
- package/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp +1 -6
- package/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.cpp +8 -4
- package/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.h +1 -0
- package/common/cpp/audioapi/core/utils/AudioNodeDestructor.cpp +3 -3
- package/ios/audioapi/ios/AudioAPIModule.mm +2 -3
- package/ios/audioapi/ios/AudioManagerModule.h +18 -0
- package/ios/audioapi/ios/AudioManagerModule.mm +94 -0
- package/ios/audioapi/ios/core/AudioPlayer.h +4 -12
- package/ios/audioapi/ios/core/AudioPlayer.m +26 -108
- package/ios/audioapi/ios/core/IOSAudioPlayer.h +1 -3
- package/ios/audioapi/ios/core/IOSAudioPlayer.mm +4 -28
- package/ios/audioapi/ios/system/AudioEngine.h +23 -0
- package/ios/audioapi/ios/system/AudioEngine.mm +137 -0
- package/ios/audioapi/ios/system/AudioSessionManager.h +22 -0
- package/ios/audioapi/ios/system/AudioSessionManager.mm +183 -0
- package/ios/audioapi/ios/system/LockScreenManager.h +23 -0
- package/ios/audioapi/ios/system/LockScreenManager.mm +295 -0
- package/ios/audioapi/ios/system/NotificationManager.h +22 -0
- package/ios/audioapi/ios/system/NotificationManager.mm +173 -0
- package/lib/commonjs/api.js +197 -0
- package/lib/commonjs/api.js.map +1 -0
- package/lib/commonjs/api.web.js +219 -0
- package/lib/commonjs/api.web.js.map +1 -0
- package/lib/commonjs/core/AnalyserNode.js +71 -0
- package/lib/commonjs/core/AnalyserNode.js.map +1 -0
- package/lib/commonjs/core/AudioBuffer.js +44 -0
- package/lib/commonjs/core/AudioBuffer.js.map +1 -0
- package/lib/commonjs/core/AudioBufferSourceNode.js +68 -0
- package/lib/commonjs/core/AudioBufferSourceNode.js.map +1 -0
- package/lib/commonjs/core/AudioContext.js +29 -0
- package/lib/commonjs/core/AudioContext.js.map +1 -0
- package/lib/commonjs/core/AudioDestinationNode.js +11 -0
- package/lib/commonjs/core/AudioDestinationNode.js.map +1 -0
- package/lib/commonjs/core/AudioNode.js +30 -0
- package/lib/commonjs/core/AudioNode.js.map +1 -0
- package/lib/commonjs/core/AudioParam.js +82 -0
- package/lib/commonjs/core/AudioParam.js.map +1 -0
- package/lib/commonjs/core/AudioScheduledSourceNode.js +38 -0
- package/lib/commonjs/core/AudioScheduledSourceNode.js.map +1 -0
- package/lib/commonjs/core/BaseAudioContext.js +80 -0
- package/lib/commonjs/core/BaseAudioContext.js.map +1 -0
- package/lib/commonjs/core/BiquadFilterNode.js +33 -0
- package/lib/commonjs/core/BiquadFilterNode.js.map +1 -0
- package/lib/commonjs/core/GainNode.js +17 -0
- package/lib/commonjs/core/GainNode.js.map +1 -0
- package/lib/commonjs/core/OfflineAudioContext.js +63 -0
- package/lib/commonjs/core/OfflineAudioContext.js.map +1 -0
- package/lib/commonjs/core/OscillatorNode.js +32 -0
- package/lib/commonjs/core/OscillatorNode.js.map +1 -0
- package/lib/commonjs/core/PeriodicWave.js +15 -0
- package/lib/commonjs/core/PeriodicWave.js.map +1 -0
- package/lib/commonjs/core/StereoPannerNode.js +17 -0
- package/lib/commonjs/core/StereoPannerNode.js.map +1 -0
- package/lib/commonjs/errors/IndexSizeError.js +14 -0
- package/lib/commonjs/errors/IndexSizeError.js.map +1 -0
- package/lib/commonjs/errors/InvalidAccessError.js +14 -0
- package/lib/commonjs/errors/InvalidAccessError.js.map +1 -0
- package/lib/commonjs/errors/InvalidStateError.js +14 -0
- package/lib/commonjs/errors/InvalidStateError.js.map +1 -0
- package/lib/commonjs/errors/NotSupportedError.js +14 -0
- package/lib/commonjs/errors/NotSupportedError.js.map +1 -0
- package/lib/commonjs/errors/RangeError.js +14 -0
- package/lib/commonjs/errors/RangeError.js.map +1 -0
- package/lib/commonjs/errors/index.js +42 -0
- package/lib/commonjs/errors/index.js.map +1 -0
- package/lib/commonjs/index.js +17 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/interfaces.js +6 -0
- package/lib/commonjs/interfaces.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/plugin/withAudioAPI.js +62 -0
- package/lib/commonjs/plugin/withAudioAPI.js.map +1 -0
- package/lib/commonjs/specs/NativeAudioAPIModule.js +9 -0
- package/lib/commonjs/specs/NativeAudioAPIModule.js.map +1 -0
- package/lib/commonjs/specs/NativeAudioManagerModule.js +33 -0
- package/lib/commonjs/specs/NativeAudioManagerModule.js.map +1 -0
- package/lib/commonjs/specs/index.js +27 -0
- package/lib/commonjs/specs/index.js.map +1 -0
- package/lib/commonjs/system/AudioManager.js +79 -0
- package/lib/commonjs/system/AudioManager.js.map +1 -0
- package/lib/commonjs/system/index.js +14 -0
- package/lib/commonjs/system/index.js.map +1 -0
- package/lib/commonjs/system/types.js +2 -0
- package/lib/commonjs/system/types.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils/index.js +10 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/web-core/AnalyserNode.js +38 -0
- package/lib/commonjs/web-core/AnalyserNode.js.map +1 -0
- package/lib/commonjs/web-core/AudioBuffer.js +44 -0
- package/lib/commonjs/web-core/AudioBuffer.js.map +1 -0
- package/lib/commonjs/web-core/AudioBufferSourceNode.js +214 -0
- package/lib/commonjs/web-core/AudioBufferSourceNode.js.map +1 -0
- package/lib/commonjs/web-core/AudioContext.js +93 -0
- package/lib/commonjs/web-core/AudioContext.js.map +1 -0
- package/lib/commonjs/web-core/AudioDestinationNode.js +11 -0
- package/lib/commonjs/web-core/AudioDestinationNode.js.map +1 -0
- package/lib/commonjs/web-core/AudioNode.js +33 -0
- package/lib/commonjs/web-core/AudioNode.js.map +1 -0
- package/lib/commonjs/web-core/AudioParam.js +81 -0
- package/lib/commonjs/web-core/AudioParam.js.map +1 -0
- package/lib/commonjs/web-core/AudioScheduledSourceNode.js +41 -0
- package/lib/commonjs/web-core/AudioScheduledSourceNode.js.map +1 -0
- package/lib/commonjs/web-core/BaseAudioContext.js +2 -0
- package/lib/commonjs/web-core/BaseAudioContext.js.map +1 -0
- package/lib/commonjs/web-core/BiquadFilterNode.js +33 -0
- package/lib/commonjs/web-core/BiquadFilterNode.js.map +1 -0
- package/lib/commonjs/web-core/GainNode.js +17 -0
- package/lib/commonjs/web-core/GainNode.js.map +1 -0
- package/lib/commonjs/web-core/OfflineAudioContext.js +96 -0
- package/lib/commonjs/web-core/OfflineAudioContext.js.map +1 -0
- package/lib/commonjs/web-core/OscillatorNode.js +31 -0
- package/lib/commonjs/web-core/OscillatorNode.js.map +1 -0
- package/lib/commonjs/web-core/PeriodicWave.js +15 -0
- package/lib/commonjs/web-core/PeriodicWave.js.map +1 -0
- package/lib/commonjs/web-core/StereoPannerNode.js +17 -0
- package/lib/commonjs/web-core/StereoPannerNode.js.map +1 -0
- package/lib/commonjs/web-core/custom/LoadCustomWasm.js +37 -0
- package/lib/commonjs/web-core/custom/LoadCustomWasm.js.map +1 -0
- package/lib/commonjs/web-core/custom/index.js +14 -0
- package/lib/commonjs/web-core/custom/index.js.map +1 -0
- package/lib/commonjs/web-core/custom/signalsmithStretch/LICENSE.txt +21 -0
- package/lib/commonjs/web-core/custom/signalsmithStretch/README.md +46 -0
- package/lib/commonjs/web-core/custom/signalsmithStretch/SignalsmithStretch.mjs +826 -0
- package/lib/commonjs/web-core/custom/signalsmithStretch/SignalsmithStretch.mjs.map +1 -0
- package/lib/module/api.js +1 -0
- package/lib/module/api.js.map +1 -1
- package/lib/module/core/AudioContext.js +2 -1
- package/lib/module/core/AudioContext.js.map +1 -1
- package/lib/module/plugin/withAudioAPI.js +58 -0
- package/lib/module/plugin/withAudioAPI.js.map +1 -0
- package/lib/module/specs/NativeAudioManagerModule.js +30 -0
- package/lib/module/specs/NativeAudioManagerModule.js.map +1 -0
- package/lib/module/specs/index.js +6 -0
- package/lib/module/specs/index.js.map +1 -0
- package/lib/module/system/AudioManager.js +75 -0
- package/lib/module/system/AudioManager.js.map +1 -0
- package/lib/module/system/index.js +4 -0
- package/lib/module/system/index.js.map +1 -0
- package/lib/module/system/types.js +2 -0
- package/lib/module/system/types.js.map +1 -0
- package/lib/typescript/api.d.ts +1 -0
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/plugin/withAudioAPI.d.ts +9 -0
- package/lib/typescript/plugin/withAudioAPI.d.ts.map +1 -0
- package/lib/typescript/specs/NativeAudioManagerModule.d.ts +14 -0
- package/lib/typescript/specs/NativeAudioManagerModule.d.ts.map +1 -0
- package/lib/typescript/specs/index.d.ts +4 -0
- package/lib/typescript/specs/index.d.ts.map +1 -0
- package/lib/typescript/system/AudioManager.d.ts +14 -0
- package/lib/typescript/system/AudioManager.d.ts.map +1 -0
- package/lib/typescript/system/index.d.ts +2 -0
- package/lib/typescript/system/index.d.ts.map +1 -0
- package/lib/typescript/system/types.d.ts +40 -0
- package/lib/typescript/system/types.d.ts.map +1 -0
- package/package.json +7 -4
- package/src/api.ts +1 -0
- package/src/core/AudioContext.ts +6 -1
- package/src/plugin/withAudioAPI.ts +90 -0
- package/src/specs/NativeAudioManagerModule.ts +48 -0
- package/src/specs/index.ts +6 -0
- package/src/system/AudioManager.ts +149 -0
- package/src/system/index.ts +1 -0
- package/src/system/types.ts +84 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
#import <audioapi/ios/AudioManagerModule.h>
|
|
2
|
+
#import <audioapi/ios/system/AudioEngine.h>
|
|
3
|
+
#import <audioapi/ios/system/AudioSessionManager.h>
|
|
4
|
+
#import <audioapi/ios/system/NotificationManager.h>
|
|
5
|
+
|
|
6
|
+
@implementation NotificationManager
|
|
7
|
+
|
|
8
|
+
static NotificationManager *_sharedInstance = nil;
|
|
9
|
+
|
|
10
|
+
+ (instancetype)sharedInstanceWithAudioManagerModule:(AudioManagerModule *)audioManagerModule
|
|
11
|
+
{
|
|
12
|
+
static dispatch_once_t onceToken;
|
|
13
|
+
dispatch_once(&onceToken, ^{
|
|
14
|
+
_sharedInstance = [[self alloc] initPrivateWithAudioManagerModule:audioManagerModule];
|
|
15
|
+
});
|
|
16
|
+
return _sharedInstance;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (instancetype)init
|
|
20
|
+
{
|
|
21
|
+
@throw [NSException exceptionWithName:@"Singleton" reason:@"Use +[NotificationManager sharedInstance]" userInfo:nil];
|
|
22
|
+
return nil;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (instancetype)initPrivateWithAudioManagerModule:(AudioManagerModule *)audioManagerModule
|
|
26
|
+
{
|
|
27
|
+
if (self = [super init]) {
|
|
28
|
+
self.audioManagerModule = audioManagerModule;
|
|
29
|
+
self.notificationCenter = [NSNotificationCenter defaultCenter];
|
|
30
|
+
self.audioInterruptionsObserved = false;
|
|
31
|
+
|
|
32
|
+
[self configureNotifications];
|
|
33
|
+
}
|
|
34
|
+
return self;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (void)cleanup
|
|
38
|
+
{
|
|
39
|
+
NSLog(@"[NotificationManager] cleanup");
|
|
40
|
+
|
|
41
|
+
self.notificationCenter = nil;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (void)observeAudioInterruptions:(BOOL)enabled
|
|
45
|
+
{
|
|
46
|
+
if (self.audioInterruptionsObserved == enabled) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (enabled) {
|
|
51
|
+
[self.notificationCenter addObserver:self
|
|
52
|
+
selector:@selector(handleInterruption:)
|
|
53
|
+
name:AVAudioSessionInterruptionNotification
|
|
54
|
+
object:nil];
|
|
55
|
+
} else {
|
|
56
|
+
[self.notificationCenter removeObserver:self name:AVAudioSessionInterruptionNotification object:nil];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
self.audioInterruptionsObserved = enabled;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
- (void)configureNotifications
|
|
63
|
+
{
|
|
64
|
+
[self.notificationCenter addObserver:self
|
|
65
|
+
selector:@selector(handleRouteChange:)
|
|
66
|
+
name:AVAudioSessionRouteChangeNotification
|
|
67
|
+
object:nil];
|
|
68
|
+
[self.notificationCenter addObserver:self
|
|
69
|
+
selector:@selector(handleMediaServicesReset:)
|
|
70
|
+
name:AVAudioSessionMediaServicesWereResetNotification
|
|
71
|
+
object:nil];
|
|
72
|
+
[self.notificationCenter addObserver:self
|
|
73
|
+
selector:@selector(handleEngineConfigurationChange:)
|
|
74
|
+
name:AVAudioEngineConfigurationChangeNotification
|
|
75
|
+
object:nil];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
- (void)handleInterruption:(NSNotification *)notification
|
|
79
|
+
{
|
|
80
|
+
if (!self.audioInterruptionsObserved) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
NSInteger interruptionType = [notification.userInfo[AVAudioSessionInterruptionTypeKey] integerValue];
|
|
85
|
+
NSInteger interruptionOption = [notification.userInfo[AVAudioSessionInterruptionOptionKey] integerValue];
|
|
86
|
+
|
|
87
|
+
if (interruptionType == AVAudioSessionInterruptionTypeBegan) {
|
|
88
|
+
[self.audioManagerModule sendEventWithName:@"onInterruption"
|
|
89
|
+
body:@{@"type" : @"began", @"shouldResume" : @"false"}];
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (interruptionOption == AVAudioSessionInterruptionOptionShouldResume) {
|
|
94
|
+
[self.audioManagerModule sendEventWithName:@"onInterruption" body:@{@"type" : @"ended", @"shouldResume" : @"true"}];
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[self.audioManagerModule sendEventWithName:@"onInterruption" body:@{@"type" : @"ended", @"shouldResume" : @"false"}];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
- (void)handleRouteChange:(NSNotification *)notification
|
|
102
|
+
{
|
|
103
|
+
NSInteger routeChangeReason = [notification.userInfo[AVAudioSessionRouteChangeReasonKey] integerValue];
|
|
104
|
+
NSString *reasonStr;
|
|
105
|
+
|
|
106
|
+
switch (routeChangeReason) {
|
|
107
|
+
case AVAudioSessionRouteChangeReasonUnknown:
|
|
108
|
+
reasonStr = @"Unknown";
|
|
109
|
+
break;
|
|
110
|
+
case AVAudioSessionRouteChangeReasonOverride:
|
|
111
|
+
reasonStr = @"Override";
|
|
112
|
+
break;
|
|
113
|
+
case AVAudioSessionRouteChangeReasonCategoryChange:
|
|
114
|
+
reasonStr = @"CategoryChange";
|
|
115
|
+
break;
|
|
116
|
+
case AVAudioSessionRouteChangeReasonWakeFromSleep:
|
|
117
|
+
reasonStr = @"WakeFromSleep";
|
|
118
|
+
break;
|
|
119
|
+
case AVAudioSessionRouteChangeReasonNewDeviceAvailable:
|
|
120
|
+
reasonStr = @"NewDeviceAvailable";
|
|
121
|
+
break;
|
|
122
|
+
case AVAudioSessionRouteChangeReasonOldDeviceUnavailable:
|
|
123
|
+
reasonStr = @"OldDeviceUnavailable";
|
|
124
|
+
break;
|
|
125
|
+
case AVAudioSessionRouteChangeReasonRouteConfigurationChange:
|
|
126
|
+
reasonStr = @"ConfigurationChange";
|
|
127
|
+
break;
|
|
128
|
+
case AVAudioSessionRouteChangeReasonNoSuitableRouteForCategory:
|
|
129
|
+
reasonStr = @"NoSuitableRouteForCategory";
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
reasonStr = @"DoubleUnknown";
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[self.audioManagerModule sendEventWithName:@"onRouteChange" body:@{@"reason" : @"reasonStr"}];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
- (void)handleMediaServicesReset:(NSNotification *)notification
|
|
140
|
+
{
|
|
141
|
+
NSLog(@"[NotificationManager] Media services have been reset, tearing down and rebuilding everything.");
|
|
142
|
+
AudioEngine *audioEngine = [AudioEngine sharedInstance];
|
|
143
|
+
AudioSessionManager *audioSessionManager = [AudioSessionManager sharedInstance];
|
|
144
|
+
|
|
145
|
+
[self cleanup];
|
|
146
|
+
[audioSessionManager configureAudioSession];
|
|
147
|
+
[self configureNotifications];
|
|
148
|
+
[audioEngine rebuildAudioEngine];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
- (void)handleEngineConfigurationChange:(NSNotification *)notification
|
|
152
|
+
{
|
|
153
|
+
AudioEngine *audioEngine = [AudioEngine sharedInstance];
|
|
154
|
+
|
|
155
|
+
if (![audioEngine isRunning]) {
|
|
156
|
+
NSLog(
|
|
157
|
+
@"[NotificationManager] detected engine configuration change when engine is not running, marking for rebuild");
|
|
158
|
+
self.hadConfigurationChange = true;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (self.isInterrupted) {
|
|
163
|
+
NSLog(@"[NotificationManager] detected engine configuration change during interruption, marking for rebuild");
|
|
164
|
+
self.hadConfigurationChange = true;
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
169
|
+
[audioEngine rebuildAudioEngine];
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@end
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AnalyserNode", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AnalyserNode.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AudioBuffer", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _AudioBuffer.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "AudioBufferSourceNode", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _AudioBufferSourceNode.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "AudioContext", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _AudioContext.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "AudioDestinationNode", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _AudioDestinationNode.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "AudioManager", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _system.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "AudioNode", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _AudioNode.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "AudioParam", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _AudioParam.default;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "AudioScheduledSourceNode", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _AudioScheduledSourceNode.default;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "BaseAudioContext", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _BaseAudioContext.default;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "BiquadFilterNode", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _BiquadFilterNode.default;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "BiquadFilterType", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _types.BiquadFilterType;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "ChannelCountMode", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _types.ChannelCountMode;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "ChannelInterpretation", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _types.ChannelInterpretation;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "ContextState", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _types.ContextState;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "GainNode", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _GainNode.default;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "IndexSizeError", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _errors.IndexSizeError;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "InvalidAccessError", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _errors.InvalidAccessError;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "InvalidStateError", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _errors.InvalidStateError;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "NotSupportedError", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _errors.NotSupportedError;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "OfflineAudioContext", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _OfflineAudioContext.default;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "OscillatorNode", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _OscillatorNode.default;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "OscillatorType", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _types.OscillatorType;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "PeriodicWaveConstraints", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _types.PeriodicWaveConstraints;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "RangeError", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _errors.RangeError;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "StereoPannerNode", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _StereoPannerNode.default;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "WindowType", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _types.WindowType;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
var _NativeAudioAPIModule = _interopRequireDefault(require("./specs/NativeAudioAPIModule"));
|
|
169
|
+
var _AudioBuffer = _interopRequireDefault(require("./core/AudioBuffer"));
|
|
170
|
+
var _AudioBufferSourceNode = _interopRequireDefault(require("./core/AudioBufferSourceNode"));
|
|
171
|
+
var _AudioContext = _interopRequireDefault(require("./core/AudioContext"));
|
|
172
|
+
var _OfflineAudioContext = _interopRequireDefault(require("./core/OfflineAudioContext"));
|
|
173
|
+
var _AudioDestinationNode = _interopRequireDefault(require("./core/AudioDestinationNode"));
|
|
174
|
+
var _AudioNode = _interopRequireDefault(require("./core/AudioNode"));
|
|
175
|
+
var _AnalyserNode = _interopRequireDefault(require("./core/AnalyserNode"));
|
|
176
|
+
var _AudioParam = _interopRequireDefault(require("./core/AudioParam"));
|
|
177
|
+
var _AudioScheduledSourceNode = _interopRequireDefault(require("./core/AudioScheduledSourceNode"));
|
|
178
|
+
var _BaseAudioContext = _interopRequireDefault(require("./core/BaseAudioContext"));
|
|
179
|
+
var _BiquadFilterNode = _interopRequireDefault(require("./core/BiquadFilterNode"));
|
|
180
|
+
var _GainNode = _interopRequireDefault(require("./core/GainNode"));
|
|
181
|
+
var _OscillatorNode = _interopRequireDefault(require("./core/OscillatorNode"));
|
|
182
|
+
var _StereoPannerNode = _interopRequireDefault(require("./core/StereoPannerNode"));
|
|
183
|
+
var _system = _interopRequireDefault(require("./system"));
|
|
184
|
+
var _types = require("./types");
|
|
185
|
+
var _errors = require("./errors");
|
|
186
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
187
|
+
/* eslint-disable no-var */
|
|
188
|
+
|
|
189
|
+
/* eslint-disable no-var */
|
|
190
|
+
|
|
191
|
+
if (global.createAudioContext == null || global.createOfflineAudioContext == null) {
|
|
192
|
+
if (!_NativeAudioAPIModule.default) {
|
|
193
|
+
throw new Error(`Failed to install react-native-audio-api: The native module could not be found.`);
|
|
194
|
+
}
|
|
195
|
+
_NativeAudioAPIModule.default.install();
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_NativeAudioAPIModule","_interopRequireDefault","require","_AudioBuffer","_AudioBufferSourceNode","_AudioContext","_OfflineAudioContext","_AudioDestinationNode","_AudioNode","_AnalyserNode","_AudioParam","_AudioScheduledSourceNode","_BaseAudioContext","_BiquadFilterNode","_GainNode","_OscillatorNode","_StereoPannerNode","_system","_types","_errors","e","__esModule","default","global","createAudioContext","createOfflineAudioContext","NativeAudioAPIModule","Error","install"],"sourceRoot":"../../src","sources":["api.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,KAAK,CACb,iFACF,CAAC;EACH;EAEAD,6BAAoB,CAACE,OAAO,CAAC,CAAC;AAChC","ignoreList":[]}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
AudioBuffer: true,
|
|
8
|
+
AudioBufferSourceNode: true,
|
|
9
|
+
AudioContext: true,
|
|
10
|
+
OfflineAudioContext: true,
|
|
11
|
+
AudioDestinationNode: true,
|
|
12
|
+
AudioNode: true,
|
|
13
|
+
AnalyserNode: true,
|
|
14
|
+
AudioParam: true,
|
|
15
|
+
AudioScheduledSourceNode: true,
|
|
16
|
+
BaseAudioContext: true,
|
|
17
|
+
BiquadFilterNode: true,
|
|
18
|
+
GainNode: true,
|
|
19
|
+
OscillatorNode: true,
|
|
20
|
+
StereoPannerNode: true,
|
|
21
|
+
OscillatorType: true,
|
|
22
|
+
BiquadFilterType: true,
|
|
23
|
+
ChannelCountMode: true,
|
|
24
|
+
ChannelInterpretation: true,
|
|
25
|
+
ContextState: true,
|
|
26
|
+
WindowType: true,
|
|
27
|
+
PeriodicWaveConstraints: true,
|
|
28
|
+
IndexSizeError: true,
|
|
29
|
+
InvalidAccessError: true,
|
|
30
|
+
InvalidStateError: true,
|
|
31
|
+
RangeError: true,
|
|
32
|
+
NotSupportedError: true
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "AnalyserNode", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return _AnalyserNode.default;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "AudioBuffer", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _AudioBuffer.default;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "AudioBufferSourceNode", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return _AudioBufferSourceNode.default;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "AudioContext", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return _AudioContext.default;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "AudioDestinationNode", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () {
|
|
61
|
+
return _AudioDestinationNode.default;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "AudioNode", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return _AudioNode.default;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "AudioParam", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () {
|
|
73
|
+
return _AudioParam.default;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "AudioScheduledSourceNode", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _AudioScheduledSourceNode.default;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "BaseAudioContext", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return _BaseAudioContext.default;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "BiquadFilterNode", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () {
|
|
91
|
+
return _BiquadFilterNode.default;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "BiquadFilterType", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () {
|
|
97
|
+
return _types.BiquadFilterType;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(exports, "ChannelCountMode", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () {
|
|
103
|
+
return _types.ChannelCountMode;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "ChannelInterpretation", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () {
|
|
109
|
+
return _types.ChannelInterpretation;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(exports, "ContextState", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function () {
|
|
115
|
+
return _types.ContextState;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "GainNode", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return _GainNode.default;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "IndexSizeError", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () {
|
|
127
|
+
return _errors.IndexSizeError;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "InvalidAccessError", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () {
|
|
133
|
+
return _errors.InvalidAccessError;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, "InvalidStateError", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return _errors.InvalidStateError;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "NotSupportedError", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _errors.NotSupportedError;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "OfflineAudioContext", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () {
|
|
151
|
+
return _OfflineAudioContext.default;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "OscillatorNode", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return _OscillatorNode.default;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "OscillatorType", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return _types.OscillatorType;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "PeriodicWaveConstraints", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () {
|
|
169
|
+
return _types.PeriodicWaveConstraints;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, "RangeError", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return _errors.RangeError;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "StereoPannerNode", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () {
|
|
181
|
+
return _StereoPannerNode.default;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, "WindowType", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return _types.WindowType;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
var _AudioBuffer = _interopRequireDefault(require("./web-core/AudioBuffer"));
|
|
191
|
+
var _AudioBufferSourceNode = _interopRequireDefault(require("./web-core/AudioBufferSourceNode"));
|
|
192
|
+
var _AudioContext = _interopRequireDefault(require("./web-core/AudioContext"));
|
|
193
|
+
var _OfflineAudioContext = _interopRequireDefault(require("./web-core/OfflineAudioContext"));
|
|
194
|
+
var _AudioDestinationNode = _interopRequireDefault(require("./web-core/AudioDestinationNode"));
|
|
195
|
+
var _AudioNode = _interopRequireDefault(require("./web-core/AudioNode"));
|
|
196
|
+
var _AnalyserNode = _interopRequireDefault(require("./web-core/AnalyserNode"));
|
|
197
|
+
var _AudioParam = _interopRequireDefault(require("./web-core/AudioParam"));
|
|
198
|
+
var _AudioScheduledSourceNode = _interopRequireDefault(require("./web-core/AudioScheduledSourceNode"));
|
|
199
|
+
var _BaseAudioContext = _interopRequireDefault(require("./web-core/BaseAudioContext"));
|
|
200
|
+
var _BiquadFilterNode = _interopRequireDefault(require("./web-core/BiquadFilterNode"));
|
|
201
|
+
var _GainNode = _interopRequireDefault(require("./web-core/GainNode"));
|
|
202
|
+
var _OscillatorNode = _interopRequireDefault(require("./web-core/OscillatorNode"));
|
|
203
|
+
var _StereoPannerNode = _interopRequireDefault(require("./web-core/StereoPannerNode"));
|
|
204
|
+
var _custom = require("./web-core/custom");
|
|
205
|
+
Object.keys(_custom).forEach(function (key) {
|
|
206
|
+
if (key === "default" || key === "__esModule") return;
|
|
207
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
208
|
+
if (key in exports && exports[key] === _custom[key]) return;
|
|
209
|
+
Object.defineProperty(exports, key, {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
get: function () {
|
|
212
|
+
return _custom[key];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
var _types = require("./types");
|
|
217
|
+
var _errors = require("./errors");
|
|
218
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
219
|
+
//# sourceMappingURL=api.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_AudioBuffer","_interopRequireDefault","require","_AudioBufferSourceNode","_AudioContext","_OfflineAudioContext","_AudioDestinationNode","_AudioNode","_AnalyserNode","_AudioParam","_AudioScheduledSourceNode","_BaseAudioContext","_BiquadFilterNode","_GainNode","_OscillatorNode","_StereoPannerNode","_custom","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_types","_errors","e","__esModule","default"],"sourceRoot":"../../src","sources":["api.web.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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AAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,MAAA,GAAA3B,OAAA;AAUA,IAAA4B,OAAA,GAAA5B,OAAA;AAMkB,SAAAD,uBAAA8B,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _errors = require("../errors");
|
|
8
|
+
var _AudioNode = _interopRequireDefault(require("./AudioNode"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class AnalyserNode extends _AudioNode.default {
|
|
11
|
+
static allowedFFTSize = [32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768];
|
|
12
|
+
get fftSize() {
|
|
13
|
+
return this.node.fftSize;
|
|
14
|
+
}
|
|
15
|
+
set fftSize(value) {
|
|
16
|
+
if (!AnalyserNode.allowedFFTSize.includes(value)) {
|
|
17
|
+
throw new _errors.IndexSizeError(`Provided value (${value}) must be a power of 2 between 32 and 32768`);
|
|
18
|
+
}
|
|
19
|
+
this.node.fftSize = value;
|
|
20
|
+
}
|
|
21
|
+
get minDecibels() {
|
|
22
|
+
return this.node.minDecibels;
|
|
23
|
+
}
|
|
24
|
+
set minDecibels(value) {
|
|
25
|
+
if (value >= this.maxDecibels) {
|
|
26
|
+
throw new _errors.IndexSizeError(`The minDecibels value (${value}) must be less than maxDecibels`);
|
|
27
|
+
}
|
|
28
|
+
this.node.minDecibels = value;
|
|
29
|
+
}
|
|
30
|
+
get maxDecibels() {
|
|
31
|
+
return this.node.maxDecibels;
|
|
32
|
+
}
|
|
33
|
+
set maxDecibels(value) {
|
|
34
|
+
if (value <= this.minDecibels) {
|
|
35
|
+
throw new _errors.IndexSizeError(`The maxDecibels value (${value}) must be greater than minDecibels`);
|
|
36
|
+
}
|
|
37
|
+
this.node.maxDecibels = value;
|
|
38
|
+
}
|
|
39
|
+
get smoothingTimeConstant() {
|
|
40
|
+
return this.node.smoothingTimeConstant;
|
|
41
|
+
}
|
|
42
|
+
set smoothingTimeConstant(value) {
|
|
43
|
+
if (value < 0 || value > 1) {
|
|
44
|
+
throw new _errors.IndexSizeError(`The smoothingTimeConstant value (${value}) must be between 0 and 1`);
|
|
45
|
+
}
|
|
46
|
+
this.node.smoothingTimeConstant = value;
|
|
47
|
+
}
|
|
48
|
+
get window() {
|
|
49
|
+
return this.node.window;
|
|
50
|
+
}
|
|
51
|
+
set window(value) {
|
|
52
|
+
this.node.window = value;
|
|
53
|
+
}
|
|
54
|
+
get frequencyBinCount() {
|
|
55
|
+
return this.node.frequencyBinCount;
|
|
56
|
+
}
|
|
57
|
+
getFloatFrequencyData(array) {
|
|
58
|
+
this.node.getFloatFrequencyData(array);
|
|
59
|
+
}
|
|
60
|
+
getByteFrequencyData(array) {
|
|
61
|
+
this.node.getByteFrequencyData(array);
|
|
62
|
+
}
|
|
63
|
+
getFloatTimeDomainData(array) {
|
|
64
|
+
this.node.getFloatTimeDomainData(array);
|
|
65
|
+
}
|
|
66
|
+
getByteTimeDomainData(array) {
|
|
67
|
+
this.node.getByteTimeDomainData(array);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.default = AnalyserNode;
|
|
71
|
+
//# sourceMappingURL=AnalyserNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","require","_AudioNode","_interopRequireDefault","e","__esModule","default","AnalyserNode","AudioNode","allowedFFTSize","fftSize","node","value","includes","IndexSizeError","minDecibels","maxDecibels","smoothingTimeConstant","window","frequencyBinCount","getFloatFrequencyData","array","getByteFrequencyData","getFloatTimeDomainData","getByteTimeDomainData","exports"],"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