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.
Files changed (217) hide show
  1. package/README.md +10 -8
  2. package/RNAudioAPI.podspec +5 -0
  3. package/android/CMakeLists.txt +21 -10
  4. package/android/libs/fftw3/arm64-v8a/libfftw3.a +0 -0
  5. package/android/libs/fftw3/armeabi-v7a/libfftw3.a +0 -0
  6. package/android/libs/fftw3/x86/libfftw3.a +0 -0
  7. package/android/libs/fftw3/x86_64/libfftw3.a +0 -0
  8. package/android/libs/include/fftw3/fftw3.h +413 -0
  9. package/android/src/main/cpp/AudioPlayer/AudioPlayer.cpp +32 -2
  10. package/android/src/main/cpp/AudioPlayer/AudioPlayer.h +6 -2
  11. package/common/cpp/AudioAPIInstaller/AudioAPIInstallerHostObject.cpp +5 -3
  12. package/common/cpp/AudioAPIInstaller/AudioAPIInstallerHostObject.h +5 -1
  13. package/common/cpp/HostObjects/AudioBufferHostObject.cpp +6 -0
  14. package/common/cpp/HostObjects/AudioBufferSourceNodeHostObject.cpp +13 -1
  15. package/common/cpp/HostObjects/AudioContextHostObject.cpp +12 -149
  16. package/common/cpp/HostObjects/AudioContextHostObject.h +8 -14
  17. package/common/cpp/HostObjects/AudioNodeHostObject.cpp +0 -6
  18. package/common/cpp/HostObjects/BaseAudioContextHostObject.cpp +240 -0
  19. package/common/cpp/HostObjects/BaseAudioContextHostObject.h +41 -0
  20. package/common/cpp/HostObjects/BiquadFilterNodeHostObject.cpp +44 -0
  21. package/common/cpp/HostObjects/OscillatorNodeHostObject.cpp +21 -0
  22. package/common/cpp/HostObjects/OscillatorNodeHostObject.h +1 -0
  23. package/common/cpp/HostObjects/PeriodicWaveHostObject.cpp +33 -0
  24. package/common/cpp/HostObjects/PeriodicWaveHostObject.h +33 -0
  25. package/common/cpp/core/AudioArray.cpp +117 -0
  26. package/common/cpp/core/AudioArray.h +48 -0
  27. package/common/cpp/core/AudioBuffer.cpp +23 -80
  28. package/common/cpp/core/AudioBuffer.h +12 -13
  29. package/common/cpp/core/AudioBufferSourceNode.cpp +112 -25
  30. package/common/cpp/core/AudioBufferSourceNode.h +10 -6
  31. package/common/cpp/core/AudioBus.cpp +518 -0
  32. package/common/cpp/core/AudioBus.h +83 -0
  33. package/common/cpp/core/AudioContext.cpp +7 -77
  34. package/common/cpp/core/AudioContext.h +3 -60
  35. package/common/cpp/core/AudioDestinationNode.cpp +27 -15
  36. package/common/cpp/core/AudioDestinationNode.h +13 -5
  37. package/common/cpp/core/AudioNode.cpp +184 -22
  38. package/common/cpp/core/AudioNode.h +37 -37
  39. package/common/cpp/core/AudioNodeManager.cpp +75 -0
  40. package/common/cpp/core/AudioNodeManager.h +42 -0
  41. package/common/cpp/core/AudioParam.cpp +8 -11
  42. package/common/cpp/core/AudioParam.h +8 -8
  43. package/common/cpp/core/AudioScheduledSourceNode.cpp +19 -5
  44. package/common/cpp/core/AudioScheduledSourceNode.h +6 -2
  45. package/common/cpp/core/BaseAudioContext.cpp +191 -0
  46. package/common/cpp/core/BaseAudioContext.h +87 -0
  47. package/common/cpp/core/BiquadFilterNode.cpp +92 -69
  48. package/common/cpp/core/BiquadFilterNode.h +53 -57
  49. package/common/cpp/core/GainNode.cpp +12 -12
  50. package/common/cpp/core/GainNode.h +5 -3
  51. package/common/cpp/core/OscillatorNode.cpp +38 -29
  52. package/common/cpp/core/OscillatorNode.h +29 -69
  53. package/common/cpp/core/ParamChange.h +6 -6
  54. package/common/cpp/core/PeriodicWave.cpp +362 -0
  55. package/common/cpp/core/PeriodicWave.h +119 -0
  56. package/common/cpp/core/StereoPannerNode.cpp +31 -30
  57. package/common/cpp/core/StereoPannerNode.h +6 -6
  58. package/common/cpp/types/BiquadFilterType.h +19 -0
  59. package/common/cpp/types/ChannelCountMode.h +10 -0
  60. package/common/cpp/types/ChannelInterpretation.h +10 -0
  61. package/common/cpp/types/ContextState.h +10 -0
  62. package/common/cpp/types/OscillatorType.h +11 -0
  63. package/common/cpp/utils/FFTFrame.h +67 -0
  64. package/common/cpp/utils/JsiPromise.cpp +59 -0
  65. package/common/cpp/utils/JsiPromise.h +42 -0
  66. package/common/cpp/utils/Locker.h +49 -0
  67. package/common/cpp/utils/VectorMath.cpp +88 -3
  68. package/common/cpp/utils/VectorMath.h +7 -1
  69. package/common/cpp/utils/android/FFTFrame.cpp +23 -0
  70. package/common/cpp/utils/ios/FFTFrame.cpp +29 -0
  71. package/common/cpp/wrappers/AudioBufferSourceNodeWrapper.cpp +10 -0
  72. package/common/cpp/wrappers/AudioBufferSourceNodeWrapper.h +3 -2
  73. package/common/cpp/wrappers/AudioBufferWrapper.h +5 -5
  74. package/common/cpp/wrappers/AudioContextWrapper.cpp +7 -60
  75. package/common/cpp/wrappers/AudioContextWrapper.h +5 -26
  76. package/common/cpp/wrappers/AudioNodeWrapper.h +5 -5
  77. package/common/cpp/wrappers/AudioParamWrapper.h +4 -4
  78. package/common/cpp/wrappers/BaseAudioContextWrapper.cpp +83 -0
  79. package/common/cpp/wrappers/BaseAudioContextWrapper.h +50 -0
  80. package/common/cpp/wrappers/BiquadFilterNodeWrapper.cpp +9 -0
  81. package/common/cpp/wrappers/BiquadFilterNodeWrapper.h +9 -4
  82. package/common/cpp/wrappers/GainNodeWrapper.h +1 -1
  83. package/common/cpp/wrappers/OscillatorNodeWrapper.cpp +6 -0
  84. package/common/cpp/wrappers/OscillatorNodeWrapper.h +5 -2
  85. package/common/cpp/wrappers/PeriodicWaveWrapper.h +17 -0
  86. package/common/cpp/wrappers/StereoPannerNodeWrapper.h +1 -1
  87. package/ios/AudioAPIModule.h +20 -1
  88. package/ios/AudioAPIModule.mm +6 -4
  89. package/ios/AudioDecoder/AudioDecoder.h +17 -0
  90. package/ios/AudioDecoder/AudioDecoder.m +167 -0
  91. package/ios/AudioDecoder/IOSAudioDecoder.h +26 -0
  92. package/ios/AudioDecoder/IOSAudioDecoder.mm +40 -0
  93. package/ios/AudioPlayer/AudioPlayer.h +3 -2
  94. package/ios/AudioPlayer/AudioPlayer.m +14 -17
  95. package/ios/AudioPlayer/IOSAudioPlayer.h +7 -3
  96. package/ios/AudioPlayer/IOSAudioPlayer.mm +31 -7
  97. package/lib/module/core/AudioBuffer.js +37 -0
  98. package/lib/module/core/AudioBuffer.js.map +1 -0
  99. package/lib/module/core/AudioBufferSourceNode.js +28 -0
  100. package/lib/module/core/AudioBufferSourceNode.js.map +1 -0
  101. package/lib/module/core/AudioContext.js +10 -0
  102. package/lib/module/core/AudioContext.js.map +1 -0
  103. package/lib/module/core/AudioDestinationNode.js +7 -0
  104. package/lib/module/core/AudioDestinationNode.js.map +1 -0
  105. package/lib/module/core/AudioNode.js +22 -0
  106. package/lib/module/core/AudioNode.js.map +1 -0
  107. package/lib/module/core/AudioParam.js +35 -0
  108. package/lib/module/core/AudioParam.js.map +1 -0
  109. package/lib/module/core/AudioScheduledSourceNode.js +28 -0
  110. package/lib/module/core/AudioScheduledSourceNode.js.map +1 -0
  111. package/lib/module/core/BaseAudioContext.js +62 -0
  112. package/lib/module/core/BaseAudioContext.js.map +1 -0
  113. package/lib/module/core/BiquadFilterNode.js +25 -0
  114. package/lib/module/core/BiquadFilterNode.js.map +1 -0
  115. package/lib/module/core/GainNode.js +9 -0
  116. package/lib/module/core/GainNode.js.map +1 -0
  117. package/lib/module/core/OscillatorNode.js +24 -0
  118. package/lib/module/core/OscillatorNode.js.map +1 -0
  119. package/lib/module/core/PeriodicWave.js +8 -0
  120. package/lib/module/core/PeriodicWave.js.map +1 -0
  121. package/lib/module/core/StereoPannerNode.js +9 -0
  122. package/lib/module/core/StereoPannerNode.js.map +1 -0
  123. package/lib/module/core/types.js.map +1 -0
  124. package/lib/module/errors/IndexSizeError.js +8 -0
  125. package/lib/module/errors/IndexSizeError.js.map +1 -0
  126. package/lib/module/errors/InvalidAccessError.js +8 -0
  127. package/lib/module/errors/InvalidAccessError.js.map +1 -0
  128. package/lib/module/errors/InvalidStateError.js +8 -0
  129. package/lib/module/errors/InvalidStateError.js.map +1 -0
  130. package/lib/module/errors/RangeError.js +8 -0
  131. package/lib/module/errors/RangeError.js.map +1 -0
  132. package/lib/module/errors/index.js +5 -0
  133. package/lib/module/errors/index.js.map +1 -0
  134. package/lib/module/index.js +212 -15
  135. package/lib/module/index.js.map +1 -1
  136. package/lib/module/index.native.js +18 -0
  137. package/lib/module/index.native.js.map +1 -0
  138. package/lib/module/interfaces.js +2 -0
  139. package/lib/module/interfaces.js.map +1 -0
  140. package/lib/module/utils/resolveAudioSource.js +10 -0
  141. package/lib/module/utils/resolveAudioSource.js.map +1 -0
  142. package/lib/typescript/core/AudioBuffer.d.ts +12 -0
  143. package/lib/typescript/core/AudioBuffer.d.ts.map +1 -0
  144. package/lib/typescript/core/AudioBufferSourceNode.d.ts +12 -0
  145. package/lib/typescript/core/AudioBufferSourceNode.d.ts.map +1 -0
  146. package/lib/typescript/core/AudioContext.d.ts +6 -0
  147. package/lib/typescript/core/AudioContext.d.ts.map +1 -0
  148. package/lib/typescript/core/AudioDestinationNode.d.ts +7 -0
  149. package/lib/typescript/core/AudioDestinationNode.d.ts.map +1 -0
  150. package/lib/typescript/core/AudioNode.d.ts +16 -0
  151. package/lib/typescript/core/AudioNode.d.ts.map +1 -0
  152. package/lib/typescript/core/AudioParam.d.ts +14 -0
  153. package/lib/typescript/core/AudioParam.d.ts.map +1 -0
  154. package/lib/typescript/core/AudioScheduledSourceNode.d.ts +10 -0
  155. package/lib/typescript/core/AudioScheduledSourceNode.d.ts.map +1 -0
  156. package/lib/typescript/core/BaseAudioContext.d.ts +27 -0
  157. package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -0
  158. package/lib/typescript/core/BiquadFilterNode.d.ts +16 -0
  159. package/lib/typescript/core/BiquadFilterNode.d.ts.map +1 -0
  160. package/lib/typescript/core/GainNode.d.ts +9 -0
  161. package/lib/typescript/core/GainNode.d.ts.map +1 -0
  162. package/lib/typescript/core/OscillatorNode.d.ts +15 -0
  163. package/lib/typescript/core/OscillatorNode.d.ts.map +1 -0
  164. package/lib/typescript/core/PeriodicWave.d.ts +5 -0
  165. package/lib/typescript/core/PeriodicWave.d.ts.map +1 -0
  166. package/lib/typescript/core/StereoPannerNode.d.ts +9 -0
  167. package/lib/typescript/core/StereoPannerNode.d.ts.map +1 -0
  168. package/lib/typescript/core/types.d.ts +15 -0
  169. package/lib/typescript/core/types.d.ts.map +1 -0
  170. package/lib/typescript/errors/IndexSizeError.d.ts +5 -0
  171. package/lib/typescript/errors/IndexSizeError.d.ts.map +1 -0
  172. package/lib/typescript/errors/InvalidAccessError.d.ts +5 -0
  173. package/lib/typescript/errors/InvalidAccessError.d.ts.map +1 -0
  174. package/lib/typescript/errors/InvalidStateError.d.ts +5 -0
  175. package/lib/typescript/errors/InvalidStateError.d.ts.map +1 -0
  176. package/lib/typescript/errors/RangeError.d.ts +5 -0
  177. package/lib/typescript/errors/RangeError.d.ts.map +1 -0
  178. package/lib/typescript/errors/index.d.ts +5 -0
  179. package/lib/typescript/errors/index.d.ts.map +1 -0
  180. package/lib/typescript/index.d.ts +88 -5
  181. package/lib/typescript/index.d.ts.map +1 -1
  182. package/lib/typescript/index.native.d.ts +14 -0
  183. package/lib/typescript/index.native.d.ts.map +1 -0
  184. package/lib/typescript/interfaces.d.ts +79 -0
  185. package/lib/typescript/interfaces.d.ts.map +1 -0
  186. package/lib/typescript/utils/resolveAudioSource.d.ts +3 -0
  187. package/lib/typescript/utils/resolveAudioSource.d.ts.map +1 -0
  188. package/package.json +4 -2
  189. package/src/core/AudioBuffer.ts +68 -0
  190. package/src/core/AudioBufferSourceNode.ts +35 -0
  191. package/src/core/AudioContext.ts +12 -0
  192. package/src/core/AudioDestinationNode.ts +9 -0
  193. package/src/core/AudioNode.ts +38 -0
  194. package/src/core/AudioParam.ts +55 -0
  195. package/src/core/AudioScheduledSourceNode.ts +43 -0
  196. package/src/core/BaseAudioContext.ts +108 -0
  197. package/src/core/BiquadFilterNode.ts +49 -0
  198. package/src/core/GainNode.ts +13 -0
  199. package/src/core/OscillatorNode.ts +37 -0
  200. package/src/core/PeriodicWave.ts +10 -0
  201. package/src/core/StereoPannerNode.ts +13 -0
  202. package/src/core/types.ts +33 -0
  203. package/src/errors/IndexSizeError.ts +8 -0
  204. package/src/errors/InvalidAccessError.ts +8 -0
  205. package/src/errors/InvalidStateError.ts +8 -0
  206. package/src/errors/RangeError.ts +8 -0
  207. package/src/errors/index.ts +4 -0
  208. package/src/index.native.ts +25 -0
  209. package/src/index.ts +380 -40
  210. package/src/interfaces.ts +121 -0
  211. package/src/modules/global.d.ts +3 -3
  212. package/src/utils/resolveAudioSource.ts +14 -0
  213. package/lib/module/types.js.map +0 -1
  214. package/lib/typescript/types.d.ts +0 -76
  215. package/lib/typescript/types.d.ts.map +0 -1
  216. package/src/types.ts +0 -108
  217. /package/lib/module/{types.js → core/types.js} +0 -0
@@ -1,39 +1,236 @@
1
- import { installModule } from './utils/install';
2
- if (global.__AudioAPIInstaller == null) {
3
- installModule();
1
+ export class AudioBuffer {
2
+ constructor(buffer) {
3
+ this.buffer = buffer;
4
+ this.length = buffer.length;
5
+ this.duration = buffer.duration;
6
+ this.sampleRate = buffer.sampleRate;
7
+ this.numberOfChannels = buffer.numberOfChannels;
8
+ }
9
+ getChannelData(channel) {
10
+ if (channel < 0 || channel >= this.numberOfChannels) {
11
+ throw new Error(`The channel number provided (${channel}) is outside the range [0, ${this.numberOfChannels - 1}]`);
12
+ }
13
+
14
+ // TODO: we probably will want to move to Float32Array on native side too
15
+ return Array.from(this.buffer.getChannelData(channel));
16
+ }
17
+ copyFromChannel(destination, channelNumber, startInChannel = 0) {
18
+ if (channelNumber < 0 || channelNumber >= this.numberOfChannels) {
19
+ throw new Error(`The channel number provided (${channelNumber}) is outside the range [0, ${this.numberOfChannels - 1}]`);
20
+ }
21
+ if (startInChannel < 0 || startInChannel >= this.length) {
22
+ throw new Error(`The startInChannel number provided (${startInChannel}) is outside the range [0, ${this.length - 1}]`);
23
+ }
24
+ this.buffer.copyFromChannel(new Float32Array(destination), channelNumber, startInChannel);
25
+ }
26
+ copyToChannel(source, channelNumber, startInChannel = 0) {
27
+ if (channelNumber < 0 || channelNumber >= this.numberOfChannels) {
28
+ throw new Error(`The channel number provided (${channelNumber}) is outside the range [0, ${this.numberOfChannels - 1}]`);
29
+ }
30
+ if (startInChannel < 0 || startInChannel >= this.length) {
31
+ throw new Error(`The startInChannel number provided (${startInChannel}) is outside the range [0, ${this.length - 1}]`);
32
+ }
33
+ this.buffer.copyToChannel(new Float32Array(source), channelNumber, startInChannel);
34
+ }
35
+ }
36
+ export class AudioNode {
37
+ constructor(context, node) {
38
+ this.context = context;
39
+ this.node = node;
40
+ this.numberOfInputs = this.node.numberOfInputs;
41
+ this.numberOfOutputs = this.node.numberOfOutputs;
42
+ this.channelCount = this.node.channelCount;
43
+ this.channelCountMode = this.node.channelCountMode;
44
+ this.channelInterpretation = this.node.channelInterpretation;
45
+ }
46
+ connect(node) {
47
+ if (this.context !== node.context) {
48
+ throw new Error('The AudioNodes are from different BaseAudioContexts');
49
+ }
50
+ this.node.connect(node.node);
51
+ }
52
+ disconnect(node) {
53
+ this.node.disconnect(node.node);
54
+ }
55
+ }
56
+ export class AudioScheduledSourceNode extends AudioNode {
57
+ hasBeenStarted = false;
58
+ constructor(context, node) {
59
+ super(context, node);
60
+ }
61
+ start(when = 0) {
62
+ if (when < 0) {
63
+ throw new RangeError(`Time must be a finite non-negative number: ${when}`);
64
+ }
65
+ if (this.hasBeenStarted) {
66
+ throw new Error('Cannot call start more than once');
67
+ }
68
+ this.hasBeenStarted = true;
69
+ this.node.start(when);
70
+ }
71
+ stop(when = 0) {
72
+ if (when < 0) {
73
+ throw new RangeError(`Time must be a finite non-negative number: ${when}`);
74
+ }
75
+ if (!this.hasBeenStarted) {
76
+ throw new Error('Cannot call stop without calling start first');
77
+ }
78
+ this.node.stop(when);
79
+ }
80
+ }
81
+ export class AudioBufferSourceNode extends AudioScheduledSourceNode {
82
+ constructor(context, node) {
83
+ super(context, node);
84
+ }
85
+ get buffer() {
86
+ const buffer = this.node.buffer;
87
+ if (!buffer) {
88
+ return null;
89
+ }
90
+ return new AudioBuffer(buffer);
91
+ }
92
+ set buffer(buffer) {
93
+ if (!buffer) {
94
+ this.node = null;
95
+ return;
96
+ }
97
+ this.node.buffer = buffer.buffer;
98
+ }
99
+ get loop() {
100
+ return this.node.loop;
101
+ }
102
+ set loop(value) {
103
+ this.node.loop = value;
104
+ }
105
+ }
106
+ export class AudioDestinationNode extends AudioNode {
107
+ constructor(context, node) {
108
+ super(context, node);
109
+ }
110
+ }
111
+ export class AudioParam {
112
+ constructor(param) {
113
+ this.param = param;
114
+ this.defaultValue = param.defaultValue;
115
+ this.minValue = param.minValue;
116
+ this.maxValue = param.maxValue;
117
+ }
118
+ get value() {
119
+ return this.param.value;
120
+ }
121
+ set value(value) {
122
+ this.param.value = value;
123
+ }
124
+ setValueAtTime(value, startTime) {
125
+ this.param.setValueAtTime(value, startTime);
126
+ }
127
+ linearRampToValueAtTime(value, endTime) {
128
+ this.param.linearRampToValueAtTime(value, endTime);
129
+ }
130
+ exponentialRampToValueAtTime(value, endTime) {
131
+ this.param.exponentialRampToValueAtTime(value, endTime);
132
+ }
133
+ }
134
+ export class BiquadFilterNode extends AudioNode {
135
+ constructor(context, biquadFilter) {
136
+ super(context, biquadFilter);
137
+ this.frequency = new AudioParam(biquadFilter.frequency);
138
+ this.detune = new AudioParam(biquadFilter.detune);
139
+ this.Q = new AudioParam(biquadFilter.Q);
140
+ this.gain = new AudioParam(biquadFilter.gain);
141
+ }
142
+ get type() {
143
+ return this.node.type;
144
+ }
145
+ set type(value) {
146
+ this.node.type = value;
147
+ }
148
+ getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput) {
149
+ if (frequencyArray.length !== magResponseOutput.length || frequencyArray.length !== phaseResponseOutput.length) {
150
+ throw new Error(`The lengths of the arrays are not the same frequencyArray: ${frequencyArray.length}, magResponseOutput: ${magResponseOutput.length}, phaseResponseOutput: ${phaseResponseOutput.length}`);
151
+ }
152
+ this.node.getFrequencyResponse(new Float32Array(frequencyArray), new Float32Array(magResponseOutput), new Float32Array(phaseResponseOutput));
153
+ }
154
+ }
155
+ export class PeriodicWave {
156
+ constructor(periodicWave) {
157
+ this.periodicWave = periodicWave;
158
+ }
159
+ }
160
+ export class OscillatorNode extends AudioScheduledSourceNode {
161
+ constructor(context, node) {
162
+ super(context, node);
163
+ this.detune = new AudioParam(node.detune);
164
+ this.frequency = new AudioParam(node.frequency);
165
+ }
166
+ get type() {
167
+ return this.node.type;
168
+ }
169
+ set type(value) {
170
+ if (value === 'custom') {
171
+ throw new Error("'type' cannot be set directly to 'custom'. Use setPeriodicWave() to create a custom Oscillator type.");
172
+ }
173
+ this.node.type = value;
174
+ }
175
+ setPeriodicWave(wave) {
176
+ this.node.setPeriodicWave(wave.periodicWave);
177
+ }
178
+ }
179
+ export class GainNode extends AudioNode {
180
+ constructor(context, gain) {
181
+ super(context, gain);
182
+ this.gain = new AudioParam(gain.gain);
183
+ }
184
+ }
185
+ export class StereoPannerNode extends AudioNode {
186
+ constructor(context, pan) {
187
+ super(context, pan);
188
+ this.pan = new AudioParam(pan.pan);
189
+ }
4
190
  }
5
191
  export class AudioContext {
6
192
  constructor() {
7
- this.__AudioContext = global.__AudioAPIInstaller.createAudioContext();
8
- this.destination = this.__AudioContext.destination;
9
- this.sampleRate = this.__AudioContext.sampleRate;
193
+ this.context = new window.AudioContext();
194
+ this.sampleRate = this.context.sampleRate;
195
+ this.destination = new AudioDestinationNode(this, this.context.destination);
10
196
  }
11
197
  get currentTime() {
12
- return this.__AudioContext.currentTime;
198
+ return this.context.currentTime;
13
199
  }
14
200
  get state() {
15
- return this.__AudioContext.state;
201
+ return this.context.state;
16
202
  }
17
203
  createOscillator() {
18
- return this.__AudioContext.createOscillator();
204
+ return new OscillatorNode(this, this.context.createOscillator());
19
205
  }
20
206
  createGain() {
21
- return this.__AudioContext.createGain();
207
+ return new GainNode(this, this.context.createGain());
22
208
  }
23
209
  createStereoPanner() {
24
- return this.__AudioContext.createStereoPanner();
210
+ return new StereoPannerNode(this, this.context.createStereoPanner());
25
211
  }
26
212
  createBiquadFilter() {
27
- return this.__AudioContext.createBiquadFilter();
213
+ return new BiquadFilterNode(this, this.context.createBiquadFilter());
28
214
  }
29
215
  createBufferSource() {
30
- return this.__AudioContext.createBufferSource();
216
+ return new AudioBufferSourceNode(this, this.context.createBufferSource());
31
217
  }
32
218
  createBuffer(numOfChannels, length, sampleRate) {
33
- return this.__AudioContext.createBuffer(numOfChannels, length, sampleRate);
219
+ return new AudioBuffer(this.context.createBuffer(numOfChannels, length, sampleRate));
220
+ }
221
+ createPeriodicWave(real, imag, constraints) {
222
+ return new PeriodicWave(this.context.createPeriodicWave(real, imag, constraints));
223
+ }
224
+ async decodeAudioDataSource(source) {
225
+ if (typeof source === 'number') {
226
+ throw new Error('Not yet implemented');
227
+ }
228
+ const arrayBuffer = await fetch(source).then(response => response.arrayBuffer());
229
+ return new AudioBuffer(await this.context.decodeAudioData(arrayBuffer));
34
230
  }
35
231
  close() {
36
- this.__AudioContext.close();
232
+ this.context.close();
37
233
  }
38
234
  }
235
+ export { ContextState, OscillatorType, BiquadFilterType, ChannelCountMode, ChannelInterpretation } from './core/types';
39
236
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["installModule","global","__AudioAPIInstaller","AudioContext","constructor","__AudioContext","createAudioContext","destination","sampleRate","currentTime","state","createOscillator","createGain","createStereoPanner","createBiquadFilter","createBufferSource","createBuffer","numOfChannels","length","close"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAWA,SAASA,aAAa,QAAQ,iBAAiB;AAE/C,IAAIC,MAAM,CAACC,mBAAmB,IAAI,IAAI,EAAE;EACtCF,aAAa,CAAC,CAAC;AACjB;AAEA,OAAO,MAAMG,YAAY,CAA6B;EAKpDC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,cAAc,GAAGJ,MAAM,CAACC,mBAAmB,CAACI,kBAAkB,CAAC,CAAC;IAErE,IAAI,CAACC,WAAW,GAAG,IAAI,CAACF,cAAc,CAACE,WAAW;IAClD,IAAI,CAACC,UAAU,GAAG,IAAI,CAACH,cAAc,CAACG,UAAU;EAClD;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACvB,OAAO,IAAI,CAACJ,cAAc,CAACI,WAAW;EACxC;EAEA,IAAWC,KAAKA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACL,cAAc,CAACK,KAAK;EAClC;EAEAC,gBAAgBA,CAAA,EAAmB;IACjC,OAAO,IAAI,CAACN,cAAc,CAACM,gBAAgB,CAAC,CAAC;EAC/C;EAEAC,UAAUA,CAAA,EAAa;IACrB,OAAO,IAAI,CAACP,cAAc,CAACO,UAAU,CAAC,CAAC;EACzC;EAEAC,kBAAkBA,CAAA,EAAqB;IACrC,OAAO,IAAI,CAACR,cAAc,CAACQ,kBAAkB,CAAC,CAAC;EACjD;EAEAC,kBAAkBA,CAAA,EAAqB;IACrC,OAAO,IAAI,CAACT,cAAc,CAACS,kBAAkB,CAAC,CAAC;EACjD;EAEAC,kBAAkBA,CAAA,EAA0B;IAC1C,OAAO,IAAI,CAACV,cAAc,CAACU,kBAAkB,CAAC,CAAC;EACjD;EAEAC,YAAYA,CACVC,aAAqB,EACrBC,MAAc,EACdV,UAAkB,EACL;IACb,OAAO,IAAI,CAACH,cAAc,CAACW,YAAY,CAACC,aAAa,EAAEC,MAAM,EAAEV,UAAU,CAAC;EAC5E;EAEAW,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACd,cAAc,CAACc,KAAK,CAAC,CAAC;EAC7B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["AudioBuffer","constructor","buffer","length","duration","sampleRate","numberOfChannels","getChannelData","channel","Error","Array","from","copyFromChannel","destination","channelNumber","startInChannel","Float32Array","copyToChannel","source","AudioNode","context","node","numberOfInputs","numberOfOutputs","channelCount","channelCountMode","channelInterpretation","connect","disconnect","AudioScheduledSourceNode","hasBeenStarted","start","when","RangeError","stop","AudioBufferSourceNode","loop","value","AudioDestinationNode","AudioParam","param","defaultValue","minValue","maxValue","setValueAtTime","startTime","linearRampToValueAtTime","endTime","exponentialRampToValueAtTime","BiquadFilterNode","biquadFilter","frequency","detune","Q","gain","type","getFrequencyResponse","frequencyArray","magResponseOutput","phaseResponseOutput","PeriodicWave","periodicWave","OscillatorNode","setPeriodicWave","wave","GainNode","StereoPannerNode","pan","AudioContext","window","currentTime","state","createOscillator","createGain","createStereoPanner","createBiquadFilter","createBufferSource","createBuffer","numOfChannels","createPeriodicWave","real","imag","constraints","decodeAudioDataSource","arrayBuffer","fetch","then","response","decodeAudioData","close","ContextState","OscillatorType","BiquadFilterType","ChannelCountMode","ChannelInterpretation"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAMA,OAAO,MAAMA,WAAW,CAAC;EAQvBC,WAAWA,CAACC,MAA8B,EAAE;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM;IAC3B,IAAI,CAACC,QAAQ,GAAGF,MAAM,CAACE,QAAQ;IAC/B,IAAI,CAACC,UAAU,GAAGH,MAAM,CAACG,UAAU;IACnC,IAAI,CAACC,gBAAgB,GAAGJ,MAAM,CAACI,gBAAgB;EACjD;EAEOC,cAAcA,CAACC,OAAe,EAAY;IAC/C,IAAIA,OAAO,GAAG,CAAC,IAAIA,OAAO,IAAI,IAAI,CAACF,gBAAgB,EAAE;MACnD,MAAM,IAAIG,KAAK,CACb,gCAAgCD,OAAO,8BAA8B,IAAI,CAACF,gBAAgB,GAAG,CAAC,GAChG,CAAC;IACH;;IAEA;IACA,OAAOI,KAAK,CAACC,IAAI,CAAC,IAAI,CAACT,MAAM,CAACK,cAAc,CAACC,OAAO,CAAC,CAAC;EACxD;EAEOI,eAAeA,CACpBC,WAAqB,EACrBC,aAAqB,EACrBC,cAAsB,GAAG,CAAC,EAC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AI,CAACoB,OAAO,CAACoE,eAAe,CAACJ,WAAW,CAAC,CAAC;EACzE;EAEAK,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACrE,OAAO,CAACqE,KAAK,CAAC,CAAC;EACtB;AACF;AAEA,SACEC,YAAY,EACZC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,QAChB,cAAc","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import { installModule } from './utils/install';
2
+ if (global.__AudioAPIInstaller == null) {
3
+ installModule();
4
+ }
5
+ export { default as AudioBuffer } from './core/AudioBuffer';
6
+ export { default as AudioBufferSourceNode } from './core/AudioBufferSourceNode';
7
+ export { default as AudioContext } from './core/AudioContext';
8
+ export { default as AudioDestinationNode } from './core/AudioDestinationNode';
9
+ export { default as AudioNode } from './core/AudioNode';
10
+ export { default as AudioParam } from './core/AudioParam';
11
+ export { default as AudioScheduledSourceNode } from './core/AudioScheduledSourceNode';
12
+ export { default as BaseAudioContext } from './core/BaseAudioContext';
13
+ export { default as BiquadFilterNode } from './core/BiquadFilterNode';
14
+ export { default as GainNode } from './core/GainNode';
15
+ export { default as OscillatorNode } from './core/OscillatorNode';
16
+ export { default as StereoPannerNode } from './core/StereoPannerNode';
17
+ export { OscillatorType, BiquadFilterType, ChannelCountMode, ChannelInterpretation, ContextState } from './core/types';
18
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["installModule","global","__AudioAPIInstaller","default","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioNode","AudioParam","AudioScheduledSourceNode","BaseAudioContext","BiquadFilterNode","GainNode","OscillatorNode","StereoPannerNode","OscillatorType","BiquadFilterType","ChannelCountMode","ChannelInterpretation","ContextState"],"sourceRoot":"../../src","sources":["index.native.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAE/C,IAAIC,MAAM,CAACC,mBAAmB,IAAI,IAAI,EAAE;EACtCF,aAAa,CAAC,CAAC;AACjB;AAEA,SAASG,OAAO,IAAIC,WAAW,QAAQ,oBAAoB;AAC3D,SAASD,OAAO,IAAIE,qBAAqB,QAAQ,8BAA8B;AAC/E,SAASF,OAAO,IAAIG,YAAY,QAAQ,qBAAqB;AAC7D,SAASH,OAAO,IAAII,oBAAoB,QAAQ,6BAA6B;AAC7E,SAASJ,OAAO,IAAIK,SAAS,QAAQ,kBAAkB;AACvD,SAASL,OAAO,IAAIM,UAAU,QAAQ,mBAAmB;AACzD,SAASN,OAAO,IAAIO,wBAAwB,QAAQ,iCAAiC;AACrF,SAASP,OAAO,IAAIQ,gBAAgB,QAAQ,yBAAyB;AACrE,SAASR,OAAO,IAAIS,gBAAgB,QAAQ,yBAAyB;AACrE,SAAST,OAAO,IAAIU,QAAQ,QAAQ,iBAAiB;AACrD,SAASV,OAAO,IAAIW,cAAc,QAAQ,uBAAuB;AACjE,SAASX,OAAO,IAAIY,gBAAgB,QAAQ,yBAAyB;AACrE,SACEC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBAAqB,EACrBC,YAAY,QACP,cAAc","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["interfaces.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ // not sure if it works
2
+ // @ts-ignore
3
+ import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
4
+ export function resolveAudioSource(source) {
5
+ if (typeof source === 'number') {
6
+ return resolveAssetSource(source);
7
+ }
8
+ return source;
9
+ }
10
+ //# sourceMappingURL=resolveAudioSource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["resolveAssetSource","resolveAudioSource","source"],"sourceRoot":"../../../src","sources":["utils/resolveAudioSource.ts"],"mappings":"AACA;AACA;AACA,OAAOA,kBAAkB,MAAM,iDAAiD;AAEhF,OAAO,SAASC,kBAAkBA,CAChCC,MAAqC,EACxB;EACb,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOF,kBAAkB,CAACE,MAAM,CAAC;EACnC;EAEA,OAAOA,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ import { IAudioBuffer } from '../interfaces';
2
+ export default class AudioBuffer {
3
+ readonly length: number;
4
+ readonly duration: number;
5
+ readonly sampleRate: number;
6
+ readonly numberOfChannels: number;
7
+ constructor(buffer: IAudioBuffer);
8
+ getChannelData(channel: number): number[];
9
+ copyFromChannel(destination: number[], channelNumber: number, startInChannel?: number): void;
10
+ copyToChannel(source: number[], channelNumber: number, startInChannel?: number): void;
11
+ }
12
+ //# sourceMappingURL=AudioBuffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioBuffer.d.ts","sourceRoot":"","sources":["../../../src/core/AudioBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;gBAItB,MAAM,EAAE,YAAY;IAQzB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IASzC,eAAe,CACpB,WAAW,EAAE,MAAM,EAAE,EACrB,aAAa,EAAE,MAAM,EACrB,cAAc,GAAE,MAAU,GACzB,IAAI;IAgBA,aAAa,CAClB,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,MAAM,EACrB,cAAc,GAAE,MAAU,GACzB,IAAI;CAeR"}
@@ -0,0 +1,12 @@
1
+ import { IAudioBufferSourceNode } from '../interfaces';
2
+ import AudioScheduledSourceNode from './AudioScheduledSourceNode';
3
+ import BaseAudioContext from './BaseAudioContext';
4
+ import AudioBuffer from './AudioBuffer';
5
+ export default class AudioBufferSourceNode extends AudioScheduledSourceNode {
6
+ constructor(context: BaseAudioContext, node: IAudioBufferSourceNode);
7
+ get buffer(): AudioBuffer | null;
8
+ set buffer(buffer: AudioBuffer | null);
9
+ get loop(): boolean;
10
+ set loop(value: boolean);
11
+ }
12
+ //# sourceMappingURL=AudioBufferSourceNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioBufferSourceNode.d.ts","sourceRoot":"","sources":["../../../src/core/AudioBufferSourceNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,wBAAwB;gBAC7D,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,sBAAsB;IAInE,IAAW,MAAM,IAAI,WAAW,GAAG,IAAI,CAMtC;IAED,IAAW,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,EAO3C;IAED,IAAW,IAAI,IAAI,OAAO,CAEzB;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,OAAO,EAE7B;CACF"}
@@ -0,0 +1,6 @@
1
+ import BaseAudioContext from './BaseAudioContext';
2
+ export default class AudioContext extends BaseAudioContext {
3
+ constructor();
4
+ close(): void;
5
+ }
6
+ //# sourceMappingURL=AudioContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioContext.d.ts","sourceRoot":"","sources":["../../../src/core/AudioContext.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,gBAAgB;;IAKxD,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,7 @@
1
+ import { IAudioDestinationNode } from '../interfaces';
2
+ import AudioNode from './AudioNode';
3
+ import BaseAudioContext from './BaseAudioContext';
4
+ export default class AudioDestinationNode extends AudioNode {
5
+ constructor(context: BaseAudioContext, destination: IAudioDestinationNode);
6
+ }
7
+ //# sourceMappingURL=AudioDestinationNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioDestinationNode.d.ts","sourceRoot":"","sources":["../../../src/core/AudioDestinationNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,SAAS;gBAC7C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB;CAG1E"}
@@ -0,0 +1,16 @@
1
+ import { IAudioNode } from '../interfaces';
2
+ import { ChannelCountMode, ChannelInterpretation } from './types';
3
+ import BaseAudioContext from './BaseAudioContext';
4
+ export default class AudioNode {
5
+ readonly context: BaseAudioContext;
6
+ readonly numberOfInputs: number;
7
+ readonly numberOfOutputs: number;
8
+ readonly channelCount: number;
9
+ readonly channelCountMode: ChannelCountMode;
10
+ readonly channelInterpretation: ChannelInterpretation;
11
+ protected readonly node: IAudioNode;
12
+ constructor(context: BaseAudioContext, node: IAudioNode);
13
+ connect(node: AudioNode): void;
14
+ disconnect(node: AudioNode): void;
15
+ }
16
+ //# sourceMappingURL=AudioNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioNode.d.ts","sourceRoot":"","sources":["../../../src/core/AudioNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IACtD,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;gBAExB,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU;IAUhD,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAU9B,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;CAGzC"}
@@ -0,0 +1,14 @@
1
+ import { IAudioParam } from '../interfaces';
2
+ export default class AudioParam {
3
+ readonly defaultValue: number;
4
+ readonly minValue: number;
5
+ readonly maxValue: number;
6
+ private readonly audioParam;
7
+ constructor(audioParam: IAudioParam);
8
+ get value(): number;
9
+ set value(value: number);
10
+ setValueAtTime(value: number, startTime: number): void;
11
+ linearRampToValueAtTime(value: number, endTime: number): void;
12
+ exponentialRampToValueAtTime(value: number, endTime: number): void;
13
+ }
14
+ //# sourceMappingURL=AudioParam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioParam.d.ts","sourceRoot":"","sources":["../../../src/core/AudioParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;gBAE7B,UAAU,EAAE,WAAW;IAQnC,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAE7B;IAEM,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAUtD,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAU7D,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAS1E"}
@@ -0,0 +1,10 @@
1
+ import { IAudioScheduledSourceNode } from '../interfaces';
2
+ import AudioNode from './AudioNode';
3
+ import BaseAudioContext from './BaseAudioContext';
4
+ export default class AudioScheduledSourceNode extends AudioNode {
5
+ private hasBeenStarted;
6
+ constructor(context: BaseAudioContext, node: IAudioScheduledSourceNode);
7
+ start(when?: number): void;
8
+ stop(when?: number): void;
9
+ }
10
+ //# sourceMappingURL=AudioScheduledSourceNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioScheduledSourceNode.d.ts","sourceRoot":"","sources":["../../../src/core/AudioScheduledSourceNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,SAAS;IAC7D,OAAO,CAAC,cAAc,CAAkB;gBAE5B,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,yBAAyB;IAI/D,KAAK,CAAC,IAAI,GAAE,MAAU,GAAG,IAAI;IAe7B,IAAI,CAAC,IAAI,GAAE,MAAU,GAAG,IAAI;CAepC"}
@@ -0,0 +1,27 @@
1
+ import { IBaseAudioContext } from '../interfaces';
2
+ import { ContextState, PeriodicWaveConstraints, AudioSource } from './types';
3
+ import AudioDestinationNode from './AudioDestinationNode';
4
+ import OscillatorNode from './OscillatorNode';
5
+ import GainNode from './GainNode';
6
+ import StereoPannerNode from './StereoPannerNode';
7
+ import BiquadFilterNode from './BiquadFilterNode';
8
+ import AudioBufferSourceNode from './AudioBufferSourceNode';
9
+ import AudioBuffer from './AudioBuffer';
10
+ import PeriodicWave from './PeriodicWave';
11
+ export default class BaseAudioContext {
12
+ readonly destination: AudioDestinationNode;
13
+ readonly sampleRate: number;
14
+ protected readonly context: IBaseAudioContext;
15
+ constructor(context: IBaseAudioContext);
16
+ get currentTime(): number;
17
+ get state(): ContextState;
18
+ createOscillator(): OscillatorNode;
19
+ createGain(): GainNode;
20
+ createStereoPanner(): StereoPannerNode;
21
+ createBiquadFilter(): BiquadFilterNode;
22
+ createBufferSource(): AudioBufferSourceNode;
23
+ createBuffer(numOfChannels: number, length: number, sampleRate: number): AudioBuffer;
24
+ createPeriodicWave(real: number[], imag: number[], constraints?: PeriodicWaveConstraints): PeriodicWave;
25
+ decodeAudioDataSource(source: AudioSource | number): Promise<AudioBuffer>;
26
+ }
27
+ //# sourceMappingURL=BaseAudioContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseAudioContext.d.ts","sourceRoot":"","sources":["../../../src/core/BaseAudioContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;gBAElC,OAAO,EAAE,iBAAiB;IAMtC,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,IAAW,KAAK,IAAI,YAAY,CAE/B;IAED,gBAAgB,IAAI,cAAc;IAIlC,UAAU,IAAI,QAAQ;IAItB,kBAAkB,IAAI,gBAAgB;IAItC,kBAAkB,IAAI,gBAAgB;IAItC,kBAAkB,IAAI,qBAAqB;IAI3C,YAAY,CACV,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,WAAW;IAwBd,kBAAkB,CAChB,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,MAAM,EAAE,EACd,WAAW,CAAC,EAAE,uBAAuB,GACpC,YAAY;IAcT,qBAAqB,CACzB,MAAM,EAAE,WAAW,GAAG,MAAM,GAC3B,OAAO,CAAC,WAAW,CAAC;CAOxB"}
@@ -0,0 +1,16 @@
1
+ import { IBiquadFilterNode } from '../interfaces';
2
+ import AudioNode from './AudioNode';
3
+ import AudioParam from './AudioParam';
4
+ import BaseAudioContext from './BaseAudioContext';
5
+ import { BiquadFilterType } from './types';
6
+ export default class BiquadFilterNode extends AudioNode {
7
+ readonly frequency: AudioParam;
8
+ readonly detune: AudioParam;
9
+ readonly Q: AudioParam;
10
+ readonly gain: AudioParam;
11
+ constructor(context: BaseAudioContext, biquadFilter: IBiquadFilterNode);
12
+ get type(): BiquadFilterType;
13
+ set type(value: BiquadFilterType);
14
+ getFrequencyResponse(frequencyArray: number[], magResponseOutput: number[], phaseResponseOutput: number[]): void;
15
+ }
16
+ //# sourceMappingURL=BiquadFilterNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BiquadFilterNode.d.ts","sourceRoot":"","sources":["../../../src/core/BiquadFilterNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAS;IACrD,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;gBAEd,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB;IAQtE,IAAW,IAAI,IAAI,gBAAgB,CAElC;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAEtC;IAEM,oBAAoB,CACzB,cAAc,EAAE,MAAM,EAAE,EACxB,iBAAiB,EAAE,MAAM,EAAE,EAC3B,mBAAmB,EAAE,MAAM,EAAE;CAgBhC"}
@@ -0,0 +1,9 @@
1
+ import { IGainNode } from '../interfaces';
2
+ import AudioNode from './AudioNode';
3
+ import AudioParam from './AudioParam';
4
+ import BaseAudioContext from './BaseAudioContext';
5
+ export default class GainNode extends AudioNode {
6
+ readonly gain: AudioParam;
7
+ constructor(context: BaseAudioContext, gain: IGainNode);
8
+ }
9
+ //# sourceMappingURL=GainNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GainNode.d.ts","sourceRoot":"","sources":["../../../src/core/GainNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS;IAC7C,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;gBAEd,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS;CAIvD"}
@@ -0,0 +1,15 @@
1
+ import { IOscillatorNode } from '../interfaces';
2
+ import { OscillatorType } from './types';
3
+ import AudioScheduledSourceNode from './AudioScheduledSourceNode';
4
+ import AudioParam from './AudioParam';
5
+ import BaseAudioContext from './BaseAudioContext';
6
+ import PeriodicWave from './PeriodicWave';
7
+ export default class OscillatorNode extends AudioScheduledSourceNode {
8
+ readonly frequency: AudioParam;
9
+ readonly detune: AudioParam;
10
+ constructor(context: BaseAudioContext, node: IOscillatorNode);
11
+ get type(): OscillatorType;
12
+ set type(value: OscillatorType);
13
+ setPeriodicWave(wave: PeriodicWave): void;
14
+ }
15
+ //# sourceMappingURL=OscillatorNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OscillatorNode.d.ts","sourceRoot":"","sources":["../../../src/core/OscillatorNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,wBAAwB;IAClE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEhB,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe;IAO5D,IAAW,IAAI,IAAI,cAAc,CAEhC;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,cAAc,EAQpC;IAEM,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;CAGjD"}
@@ -0,0 +1,5 @@
1
+ import { IPeriodicWave } from '../interfaces';
2
+ export default class PeriodicWave {
3
+ constructor(periodicWave: IPeriodicWave);
4
+ }
5
+ //# sourceMappingURL=PeriodicWave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeriodicWave.d.ts","sourceRoot":"","sources":["../../../src/core/PeriodicWave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,YAAY;gBAInB,YAAY,EAAE,aAAa;CAGxC"}
@@ -0,0 +1,9 @@
1
+ import { IStereoPannerNode } from '../interfaces';
2
+ import AudioNode from './AudioNode';
3
+ import AudioParam from './AudioParam';
4
+ import BaseAudioContext from './BaseAudioContext';
5
+ export default class StereoPannerNode extends AudioNode {
6
+ readonly pan: AudioParam;
7
+ constructor(context: BaseAudioContext, pan: IStereoPannerNode);
8
+ }
9
+ //# sourceMappingURL=StereoPannerNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StereoPannerNode.d.ts","sourceRoot":"","sources":["../../../src/core/StereoPannerNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAS;IACrD,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;gBAEb,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,iBAAiB;CAI9D"}
@@ -0,0 +1,15 @@
1
+ export type ChannelCountMode = 'max' | 'clamped-max' | 'explicit';
2
+ export type ChannelInterpretation = 'speakers' | 'discrete';
3
+ export type BiquadFilterType = 'lowpass' | 'highpass' | 'bandpass' | 'lowshelf' | 'highshelf' | 'peaking' | 'notch' | 'allpass';
4
+ export type ContextState = 'running' | 'closed';
5
+ export type OscillatorType = 'sine' | 'square' | 'sawtooth' | 'triangle' | 'custom';
6
+ export interface PeriodicWaveConstraints {
7
+ disableNormalization: boolean;
8
+ }
9
+ /**
10
+ * A type that defines the source of the audio which can be expressed in several forms:
11
+ * 1. A string path, which could be an HTTPS URL or a local file path.
12
+ * 2. A string, which is a result of resolving an asset source.
13
+ */
14
+ export type AudioSource = string;
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,aAAa,GAAG,UAAU,CAAC;AAElE,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5D,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,uBAAuB;IACtC,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare class IndexSizeError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export default IndexSizeError;
5
+ //# sourceMappingURL=IndexSizeError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexSizeError.d.ts","sourceRoot":"","sources":["../../../src/errors/IndexSizeError.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;gBACpB,OAAO,EAAE,MAAM;CAI5B;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare class InvalidAccessError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export default InvalidAccessError;
5
+ //# sourceMappingURL=InvalidAccessError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidAccessError.d.ts","sourceRoot":"","sources":["../../../src/errors/InvalidAccessError.ts"],"names":[],"mappings":"AAAA,cAAM,kBAAmB,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare class InvalidStateError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export default InvalidStateError;
5
+ //# sourceMappingURL=InvalidStateError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidStateError.d.ts","sourceRoot":"","sources":["../../../src/errors/InvalidStateError.ts"],"names":[],"mappings":"AAAA,cAAM,iBAAkB,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare class RangeError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export default RangeError;
5
+ //# sourceMappingURL=RangeError.d.ts.map