react-native-audio-api 0.4.8 → 0.4.10-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/android/CMakeLists.txt +2 -5
- package/android/src/main/cpp/libs/pffft.c +1906 -0
- package/android/src/main/cpp/libs/pffft.h +198 -0
- package/common/cpp/HostObjects/AudioContextHostObject.h +13 -3
- package/common/cpp/core/AnalyserNode.cpp +9 -4
- package/common/cpp/core/AnalyserNode.h +2 -0
- package/common/cpp/core/AudioBufferSourceNode.cpp +12 -0
- package/common/cpp/core/AudioBufferSourceNode.h +2 -0
- package/common/cpp/core/PeriodicWave.cpp +9 -3
- package/common/cpp/utils/FFTFrame.cpp +44 -37
- package/common/cpp/utils/FFTFrame.h +5 -14
- package/lib/module/core/AudioContext.js +8 -4
- package/lib/module/core/AudioContext.js.map +1 -1
- package/lib/module/core/AudioNode.js +1 -0
- package/lib/module/core/AudioNode.js.map +1 -1
- package/lib/module/core/AudioParam.js +24 -8
- package/lib/module/core/AudioParam.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +6 -13
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/errors/NotSupportedError.js +10 -0
- package/lib/module/errors/NotSupportedError.js.map +1 -0
- package/lib/module/errors/index.js +1 -0
- package/lib/module/errors/index.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/web-core/AudioContext.js +10 -7
- package/lib/module/web-core/AudioContext.js.map +1 -1
- package/lib/module/web-core/AudioNode.js +1 -0
- package/lib/module/web-core/AudioNode.js.map +1 -1
- package/lib/module/web-core/AudioParam.js +24 -8
- package/lib/module/web-core/AudioParam.js.map +1 -1
- package/lib/typescript/core/AudioContext.d.ts +3 -2
- package/lib/typescript/core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/core/AudioNode.d.ts +1 -1
- package/lib/typescript/core/AudioNode.d.ts.map +1 -1
- package/lib/typescript/core/AudioParam.d.ts +7 -7
- package/lib/typescript/core/AudioParam.d.ts.map +1 -1
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/errors/NotSupportedError.d.ts +5 -0
- package/lib/typescript/errors/NotSupportedError.d.ts.map +1 -0
- package/lib/typescript/errors/index.d.ts +1 -0
- package/lib/typescript/errors/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/interfaces.d.ts +1 -1
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +4 -1
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioContext.d.ts +3 -3
- package/lib/typescript/web-core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioNode.d.ts +1 -1
- package/lib/typescript/web-core/AudioNode.d.ts.map +1 -1
- package/lib/typescript/web-core/AudioParam.d.ts +7 -7
- package/lib/typescript/web-core/AudioParam.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/AudioContext.ts +12 -4
- package/src/core/AudioNode.ts +3 -1
- package/src/core/AudioParam.ts +48 -15
- package/src/core/BaseAudioContext.ts +9 -16
- package/src/errors/NotSupportedError.tsx +8 -0
- package/src/errors/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/interfaces.ts +1 -1
- package/src/types.ts +5 -1
- package/src/web-core/AudioContext.tsx +20 -10
- package/src/web-core/AudioNode.tsx +3 -1
- package/src/web-core/AudioParam.tsx +48 -15
- package/android/libs/arm64-v8a/libfftw3.a +0 -0
- package/android/libs/armeabi-v7a/libfftw3.a +0 -0
- package/android/libs/include/fftw3.h +0 -413
- package/android/libs/x86/libfftw3.a +0 -0
- package/android/libs/x86_64/libfftw3.a +0 -0
package/src/core/AudioNode.ts
CHANGED
|
@@ -22,7 +22,7 @@ export default class AudioNode {
|
|
|
22
22
|
this.channelInterpretation = this.node.channelInterpretation;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
public connect(destination: AudioNode):
|
|
25
|
+
public connect(destination: AudioNode): AudioNode {
|
|
26
26
|
if (this.context !== destination.context) {
|
|
27
27
|
throw new InvalidAccessError(
|
|
28
28
|
'The AudioNodes are from different BaseAudioContexts'
|
|
@@ -30,6 +30,8 @@ export default class AudioNode {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
this.node.connect(destination.node);
|
|
33
|
+
|
|
34
|
+
return destination;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
public disconnect(destination?: AudioNode): void {
|
package/src/core/AudioParam.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAudioParam } from '../interfaces';
|
|
2
|
-
import { RangeError } from '../errors';
|
|
2
|
+
import { RangeError, InvalidStateError } from '../errors';
|
|
3
3
|
|
|
4
4
|
export default class AudioParam {
|
|
5
5
|
readonly defaultValue: number;
|
|
@@ -23,81 +23,114 @@ export default class AudioParam {
|
|
|
23
23
|
this.audioParam.value = value;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
public setValueAtTime(value: number, startTime: number):
|
|
26
|
+
public setValueAtTime(value: number, startTime: number): AudioParam {
|
|
27
27
|
if (startTime < 0) {
|
|
28
28
|
throw new RangeError(
|
|
29
|
-
`
|
|
29
|
+
`startTime must be a finite non-negative number: ${startTime}`
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
this.audioParam.setValueAtTime(value, startTime);
|
|
34
|
+
|
|
35
|
+
return this;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
public linearRampToValueAtTime(value: number, endTime: number):
|
|
38
|
+
public linearRampToValueAtTime(value: number, endTime: number): AudioParam {
|
|
37
39
|
if (endTime < 0) {
|
|
38
40
|
throw new RangeError(
|
|
39
|
-
`
|
|
41
|
+
`endTime must be a finite non-negative number: ${endTime}`
|
|
40
42
|
);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
this.audioParam.linearRampToValueAtTime(value, endTime);
|
|
46
|
+
|
|
47
|
+
return this;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
public exponentialRampToValueAtTime(
|
|
50
|
+
public exponentialRampToValueAtTime(
|
|
51
|
+
value: number,
|
|
52
|
+
endTime: number
|
|
53
|
+
): AudioParam {
|
|
47
54
|
if (endTime < 0) {
|
|
48
55
|
throw new RangeError(
|
|
49
|
-
`
|
|
56
|
+
`endTime must be a finite non-negative number: ${endTime}`
|
|
50
57
|
);
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
this.audioParam.exponentialRampToValueAtTime(value, endTime);
|
|
61
|
+
|
|
62
|
+
return this;
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
public setTargetAtTime(
|
|
57
66
|
target: number,
|
|
58
67
|
startTime: number,
|
|
59
68
|
timeConstant: number
|
|
60
|
-
):
|
|
69
|
+
): AudioParam {
|
|
61
70
|
if (startTime < 0) {
|
|
62
71
|
throw new RangeError(
|
|
63
|
-
`
|
|
72
|
+
`startTime must be a finite non-negative number: ${startTime}`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (timeConstant < 0) {
|
|
77
|
+
throw new RangeError(
|
|
78
|
+
`timeConstant must be a finite non-negative number: ${startTime}`
|
|
64
79
|
);
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
this.audioParam.setTargetAtTime(target, startTime, timeConstant);
|
|
83
|
+
|
|
84
|
+
return this;
|
|
68
85
|
}
|
|
69
86
|
|
|
70
87
|
public setValueCurveAtTime(
|
|
71
88
|
values: number[],
|
|
72
89
|
startTime: number,
|
|
73
90
|
duration: number
|
|
74
|
-
):
|
|
91
|
+
): AudioParam {
|
|
75
92
|
if (startTime < 0) {
|
|
76
93
|
throw new RangeError(
|
|
77
|
-
`
|
|
94
|
+
`startTime must be a finite non-negative number: ${startTime}`
|
|
78
95
|
);
|
|
79
96
|
}
|
|
80
97
|
|
|
98
|
+
if (duration < 0) {
|
|
99
|
+
throw new RangeError(
|
|
100
|
+
`duration must be a finite non-negative number: ${startTime}`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (values.length < 2) {
|
|
105
|
+
throw new InvalidStateError(`values must contain at least two values`);
|
|
106
|
+
}
|
|
107
|
+
|
|
81
108
|
this.audioParam.setValueCurveAtTime(values, startTime, duration);
|
|
109
|
+
|
|
110
|
+
return this;
|
|
82
111
|
}
|
|
83
112
|
|
|
84
|
-
public cancelScheduledValues(cancelTime: number):
|
|
113
|
+
public cancelScheduledValues(cancelTime: number): AudioParam {
|
|
85
114
|
if (cancelTime < 0) {
|
|
86
115
|
throw new RangeError(
|
|
87
|
-
`
|
|
116
|
+
`cancelTime must be a finite non-negative number: ${cancelTime}`
|
|
88
117
|
);
|
|
89
118
|
}
|
|
90
119
|
|
|
91
120
|
this.audioParam.cancelScheduledValues(cancelTime);
|
|
121
|
+
|
|
122
|
+
return this;
|
|
92
123
|
}
|
|
93
124
|
|
|
94
|
-
public cancelAndHoldAtTime(cancelTime: number):
|
|
125
|
+
public cancelAndHoldAtTime(cancelTime: number): AudioParam {
|
|
95
126
|
if (cancelTime < 0) {
|
|
96
127
|
throw new RangeError(
|
|
97
|
-
`
|
|
128
|
+
`cancelTime must be a finite non-negative number: ${cancelTime}`
|
|
98
129
|
);
|
|
99
130
|
}
|
|
100
131
|
|
|
101
132
|
this.audioParam.cancelAndHoldAtTime(cancelTime);
|
|
133
|
+
|
|
134
|
+
return this;
|
|
102
135
|
}
|
|
103
136
|
}
|
|
@@ -9,7 +9,7 @@ import AudioBufferSourceNode from './AudioBufferSourceNode';
|
|
|
9
9
|
import AudioBuffer from './AudioBuffer';
|
|
10
10
|
import PeriodicWave from './PeriodicWave';
|
|
11
11
|
import AnalyserNode from './AnalyserNode';
|
|
12
|
-
import { InvalidAccessError } from '../errors';
|
|
12
|
+
import { InvalidAccessError, NotSupportedError } from '../errors';
|
|
13
13
|
|
|
14
14
|
export default class BaseAudioContext {
|
|
15
15
|
readonly destination: AudioDestinationNode;
|
|
@@ -56,20 +56,20 @@ export default class BaseAudioContext {
|
|
|
56
56
|
sampleRate: number
|
|
57
57
|
): AudioBuffer {
|
|
58
58
|
if (numOfChannels < 1 || numOfChannels >= 32) {
|
|
59
|
-
throw new
|
|
59
|
+
throw new NotSupportedError(
|
|
60
60
|
`The number of channels provided (${numOfChannels}) is outside the range [1, 32]`
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
if (length <= 0) {
|
|
65
|
-
throw new
|
|
65
|
+
throw new NotSupportedError(
|
|
66
66
|
`The number of frames provided (${length}) is less than or equal to the minimum bound (0)`
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
if (sampleRate
|
|
71
|
-
throw new
|
|
72
|
-
`The sample rate provided (${sampleRate}) is outside the range [
|
|
70
|
+
if (sampleRate < 8000 || sampleRate > 96000) {
|
|
71
|
+
throw new NotSupportedError(
|
|
72
|
+
`The sample rate provided (${sampleRate}) is outside the range [8000, 96000]`
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -106,15 +106,8 @@ export default class BaseAudioContext {
|
|
|
106
106
|
sourcePath = sourcePath.replace('file://', '');
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
} catch (error) {
|
|
113
|
-
// Handle error gracefully, for example log it or throw it further with a custom message
|
|
114
|
-
console.error('Error decoding audio data source:', error);
|
|
115
|
-
throw new Error(
|
|
116
|
-
`Failed to decode audio data from source: ${sourcePath}.`
|
|
117
|
-
);
|
|
118
|
-
}
|
|
109
|
+
return new AudioBuffer(
|
|
110
|
+
await this.context.decodeAudioDataSource(sourcePath)
|
|
111
|
+
);
|
|
119
112
|
}
|
|
120
113
|
}
|
package/src/errors/index.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { default as IndexSizeError } from './IndexSizeError';
|
|
|
2
2
|
export { default as InvalidAccessError } from './InvalidAccessError';
|
|
3
3
|
export { default as InvalidStateError } from './InvalidStateError';
|
|
4
4
|
export { default as RangeError } from './RangeError';
|
|
5
|
+
export { default as NotSupportedError } from './NotSupportedError';
|
package/src/index.ts
CHANGED
package/src/interfaces.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type BiquadFilterType =
|
|
|
12
12
|
| 'notch'
|
|
13
13
|
| 'allpass';
|
|
14
14
|
|
|
15
|
-
export type ContextState = 'running' | 'closed'
|
|
15
|
+
export type ContextState = 'running' | 'closed' | `suspended`;
|
|
16
16
|
|
|
17
17
|
export type OscillatorType =
|
|
18
18
|
| 'sine'
|
|
@@ -25,4 +25,8 @@ export interface PeriodicWaveConstraints {
|
|
|
25
25
|
disableNormalization: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export interface AudioContextOptions {
|
|
29
|
+
sampleRate: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
export type WindowType = 'blackman' | 'hann';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
ContextState,
|
|
3
|
+
PeriodicWaveConstraints,
|
|
4
|
+
AudioContextOptions,
|
|
5
|
+
} from '../types';
|
|
6
|
+
import { InvalidAccessError, NotSupportedError } from '../errors';
|
|
3
7
|
import BaseAudioContext from './BaseAudioContext';
|
|
4
8
|
import AnalyserNode from './AnalyserNode';
|
|
5
9
|
import AudioDestinationNode from './AudioDestinationNode';
|
|
@@ -17,8 +21,14 @@ export default class AudioContext implements BaseAudioContext {
|
|
|
17
21
|
readonly destination: AudioDestinationNode;
|
|
18
22
|
readonly sampleRate: number;
|
|
19
23
|
|
|
20
|
-
constructor(
|
|
21
|
-
|
|
24
|
+
constructor(options?: AudioContextOptions) {
|
|
25
|
+
if (options && (options.sampleRate < 8000 || options.sampleRate > 96000)) {
|
|
26
|
+
throw new NotSupportedError(
|
|
27
|
+
`The provided sampleRate is not supported: ${options.sampleRate}`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
this.context = new window.AudioContext(options);
|
|
22
32
|
|
|
23
33
|
this.sampleRate = this.context.sampleRate;
|
|
24
34
|
this.destination = new AudioDestinationNode(this, this.context.destination);
|
|
@@ -58,20 +68,20 @@ export default class AudioContext implements BaseAudioContext {
|
|
|
58
68
|
sampleRate: number
|
|
59
69
|
): AudioBuffer {
|
|
60
70
|
if (numOfChannels < 1 || numOfChannels >= 32) {
|
|
61
|
-
throw new
|
|
71
|
+
throw new NotSupportedError(
|
|
62
72
|
`The number of channels provided (${numOfChannels}) is outside the range [1, 32]`
|
|
63
73
|
);
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
if (length <= 0) {
|
|
67
|
-
throw new
|
|
77
|
+
throw new NotSupportedError(
|
|
68
78
|
`The number of frames provided (${length}) is less than or equal to the minimum bound (0)`
|
|
69
79
|
);
|
|
70
80
|
}
|
|
71
81
|
|
|
72
|
-
if (sampleRate
|
|
73
|
-
throw new
|
|
74
|
-
`The sample rate provided (${sampleRate}) is outside the range [
|
|
82
|
+
if (sampleRate < 8000 || sampleRate > 96000) {
|
|
83
|
+
throw new NotSupportedError(
|
|
84
|
+
`The sample rate provided (${sampleRate}) is outside the range [8000, 96000]`
|
|
75
85
|
);
|
|
76
86
|
}
|
|
77
87
|
|
|
@@ -108,7 +118,7 @@ export default class AudioContext implements BaseAudioContext {
|
|
|
108
118
|
return new AudioBuffer(await this.context.decodeAudioData(arrayBuffer));
|
|
109
119
|
}
|
|
110
120
|
|
|
111
|
-
async close(): Promise<
|
|
121
|
+
async close(): Promise<undefined> {
|
|
112
122
|
await this.context.close();
|
|
113
123
|
}
|
|
114
124
|
}
|
|
@@ -21,12 +21,14 @@ export default class AudioNode {
|
|
|
21
21
|
this.channelInterpretation = this.node.channelInterpretation;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
public connect(destination: AudioNode):
|
|
24
|
+
public connect(destination: AudioNode): AudioNode {
|
|
25
25
|
if (this.context !== destination.context) {
|
|
26
26
|
throw new Error('The AudioNodes are from different BaseAudioContexts');
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
this.node.connect(destination.node);
|
|
30
|
+
|
|
31
|
+
return destination;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
public disconnect(destination?: AudioNode): void {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RangeError } from '../errors';
|
|
1
|
+
import { RangeError, InvalidStateError } from '../errors';
|
|
2
2
|
|
|
3
3
|
export default class AudioParam {
|
|
4
4
|
readonly defaultValue: number;
|
|
@@ -22,85 +22,118 @@ export default class AudioParam {
|
|
|
22
22
|
this.param.value = value;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
public setValueAtTime(value: number, startTime: number):
|
|
25
|
+
public setValueAtTime(value: number, startTime: number): AudioParam {
|
|
26
26
|
if (startTime < 0) {
|
|
27
27
|
throw new RangeError(
|
|
28
|
-
`
|
|
28
|
+
`startTime must be a finite non-negative number: ${startTime}`
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
this.param.setValueAtTime(value, startTime);
|
|
33
|
+
|
|
34
|
+
return this;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
public linearRampToValueAtTime(value: number, endTime: number):
|
|
37
|
+
public linearRampToValueAtTime(value: number, endTime: number): AudioParam {
|
|
36
38
|
if (endTime < 0) {
|
|
37
39
|
throw new RangeError(
|
|
38
|
-
`
|
|
40
|
+
`endTime must be a finite non-negative number: ${endTime}`
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
this.param.linearRampToValueAtTime(value, endTime);
|
|
45
|
+
|
|
46
|
+
return this;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
public exponentialRampToValueAtTime(
|
|
49
|
+
public exponentialRampToValueAtTime(
|
|
50
|
+
value: number,
|
|
51
|
+
endTime: number
|
|
52
|
+
): AudioParam {
|
|
46
53
|
if (endTime < 0) {
|
|
47
54
|
throw new RangeError(
|
|
48
|
-
`
|
|
55
|
+
`endTime must be a finite non-negative number: ${endTime}`
|
|
49
56
|
);
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
this.param.exponentialRampToValueAtTime(value, endTime);
|
|
60
|
+
|
|
61
|
+
return this;
|
|
53
62
|
}
|
|
54
63
|
|
|
55
64
|
public setTargetAtTime(
|
|
56
65
|
target: number,
|
|
57
66
|
startTime: number,
|
|
58
67
|
timeConstant: number
|
|
59
|
-
):
|
|
68
|
+
): AudioParam {
|
|
60
69
|
if (startTime < 0) {
|
|
61
70
|
throw new RangeError(
|
|
62
|
-
`
|
|
71
|
+
`startTime must be a finite non-negative number: ${startTime}`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (timeConstant < 0) {
|
|
76
|
+
throw new RangeError(
|
|
77
|
+
`timeConstant must be a finite non-negative number: ${startTime}`
|
|
63
78
|
);
|
|
64
79
|
}
|
|
65
80
|
|
|
66
81
|
this.param.setTargetAtTime(target, startTime, timeConstant);
|
|
82
|
+
|
|
83
|
+
return this;
|
|
67
84
|
}
|
|
68
85
|
|
|
69
86
|
public setValueCurveAtTime(
|
|
70
87
|
values: number[],
|
|
71
88
|
startTime: number,
|
|
72
89
|
duration: number
|
|
73
|
-
):
|
|
90
|
+
): AudioParam {
|
|
74
91
|
if (startTime < 0) {
|
|
75
92
|
throw new RangeError(
|
|
76
|
-
`
|
|
93
|
+
`startTime must be a finite non-negative number: ${startTime}`
|
|
77
94
|
);
|
|
78
95
|
}
|
|
79
96
|
|
|
97
|
+
if (duration < 0) {
|
|
98
|
+
throw new RangeError(
|
|
99
|
+
`duration must be a finite non-negative number: ${startTime}`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (values.length < 2) {
|
|
104
|
+
throw new InvalidStateError(`values must contain at least two values`);
|
|
105
|
+
}
|
|
106
|
+
|
|
80
107
|
this.param.setValueCurveAtTime(
|
|
81
108
|
new Float32Array(values),
|
|
82
109
|
startTime,
|
|
83
110
|
duration
|
|
84
111
|
);
|
|
112
|
+
|
|
113
|
+
return this;
|
|
85
114
|
}
|
|
86
115
|
|
|
87
|
-
public cancelScheduledValues(cancelTime: number):
|
|
116
|
+
public cancelScheduledValues(cancelTime: number): AudioParam {
|
|
88
117
|
if (cancelTime < 0) {
|
|
89
118
|
throw new RangeError(
|
|
90
|
-
`
|
|
119
|
+
`cancelTime must be a finite non-negative number: ${cancelTime}`
|
|
91
120
|
);
|
|
92
121
|
}
|
|
93
122
|
|
|
94
123
|
this.param.cancelScheduledValues(cancelTime);
|
|
124
|
+
|
|
125
|
+
return this;
|
|
95
126
|
}
|
|
96
127
|
|
|
97
|
-
public cancelAndHoldAtTime(cancelTime: number):
|
|
128
|
+
public cancelAndHoldAtTime(cancelTime: number): AudioParam {
|
|
98
129
|
if (cancelTime < 0) {
|
|
99
130
|
throw new RangeError(
|
|
100
|
-
`
|
|
131
|
+
`cancelTime must be a finite non-negative number: ${cancelTime}`
|
|
101
132
|
);
|
|
102
133
|
}
|
|
103
134
|
|
|
104
135
|
this.param.cancelAndHoldAtTime(cancelTime);
|
|
136
|
+
|
|
137
|
+
return this;
|
|
105
138
|
}
|
|
106
139
|
}
|
|
Binary file
|
|
Binary file
|