@fluex/fluexgl-dsp 0.1.3 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -86
- package/lib/dist/console-codes.d.ts +13 -13
- package/lib/dist/console-codes.js +16 -16
- package/lib/dist/core/classes/AudioClip.d.ts +67 -62
- package/lib/dist/core/classes/AudioClip.d.ts.map +1 -1
- package/lib/dist/core/classes/AudioClip.js +406 -386
- package/lib/dist/core/classes/AudioDevice.d.ts +12 -12
- package/lib/dist/core/classes/AudioDevice.js +30 -30
- package/lib/dist/core/classes/Channel.d.ts +41 -29
- package/lib/dist/core/classes/Channel.d.ts.map +1 -1
- package/lib/dist/core/classes/Channel.js +210 -144
- package/lib/dist/core/classes/DpsPipeline.d.ts +59 -59
- package/lib/dist/core/classes/DpsPipeline.js +115 -115
- package/lib/dist/core/classes/Effector.d.ts +8 -11
- package/lib/dist/core/classes/Effector.d.ts.map +1 -1
- package/lib/dist/core/classes/Effector.js +8 -20
- package/lib/dist/core/classes/Master.d.ts +11 -11
- package/lib/dist/core/classes/Master.js +35 -35
- package/lib/dist/core/exports.d.ts +6 -6
- package/lib/dist/core/exports.js +6 -6
- package/lib/dist/effects/classes/Chorus.d.ts +19 -2
- package/lib/dist/effects/classes/Chorus.d.ts.map +1 -1
- package/lib/dist/effects/classes/Chorus.js +53 -2
- package/lib/dist/effects/classes/Distortion.d.ts +6 -2
- package/lib/dist/effects/classes/Distortion.d.ts.map +1 -1
- package/lib/dist/effects/classes/Distortion.js +9 -2
- package/lib/dist/effects/classes/Equalizer.d.ts +2 -2
- package/lib/dist/effects/classes/Equalizer.js +2 -2
- package/lib/dist/effects/classes/Limiter.d.ts +2 -2
- package/lib/dist/effects/classes/Limiter.js +2 -2
- package/lib/dist/effects/classes/Saturation.d.ts +2 -2
- package/lib/dist/effects/classes/Saturation.d.ts.map +1 -1
- package/lib/dist/effects/classes/Saturation.js +2 -2
- package/lib/dist/effects/classes/SoftClip.d.ts +12 -7
- package/lib/dist/effects/classes/SoftClip.d.ts.map +1 -1
- package/lib/dist/effects/classes/SoftClip.js +54 -38
- package/lib/dist/effects/classes/StereoPanner.d.ts +3 -2
- package/lib/dist/effects/classes/StereoPanner.d.ts.map +1 -1
- package/lib/dist/effects/classes/StereoPanner.js +3 -2
- package/lib/dist/effects/classes/compressors/Compressor.d.ts +2 -2
- package/lib/dist/effects/classes/compressors/Compressor.js +2 -2
- package/lib/dist/effects/classes/compressors/MultibandCompressor.d.ts +2 -2
- package/lib/dist/effects/classes/compressors/MultibandCompressor.js +2 -2
- package/lib/dist/effects/classes/delays/AdvancedDelay.d.ts +2 -2
- package/lib/dist/effects/classes/delays/AdvancedDelay.js +2 -2
- package/lib/dist/effects/classes/delays/MonoDelay.d.ts +2 -2
- package/lib/dist/effects/classes/delays/MonoDelay.js +2 -2
- package/lib/dist/effects/classes/delays/PingPongDelay.d.ts +2 -2
- package/lib/dist/effects/classes/delays/PingPongDelay.js +2 -2
- package/lib/dist/effects/classes/delays/StereoDelay.d.ts +2 -2
- package/lib/dist/effects/classes/delays/StereoDelay.js +2 -2
- package/lib/dist/effects/classes/filters/LowPassFilter.d.ts +14 -0
- package/lib/dist/effects/classes/filters/LowPassFilter.d.ts.map +1 -0
- package/lib/dist/effects/classes/filters/LowPassFilter.js +38 -0
- package/lib/dist/effects/classes/reverbs/ChamberReverb.d.ts +2 -2
- package/lib/dist/effects/classes/reverbs/ChamberReverb.js +2 -2
- package/lib/dist/effects/classes/reverbs/ConvolverReverb.d.ts +2 -2
- package/lib/dist/effects/classes/reverbs/ConvolverReverb.js +2 -2
- package/lib/dist/effects/classes/reverbs/GenericReverb.d.ts +2 -2
- package/lib/dist/effects/classes/reverbs/GenericReverb.js +2 -2
- package/lib/dist/effects/classes/reverbs/HallReverb.d.ts +2 -2
- package/lib/dist/effects/classes/reverbs/HallReverb.js +2 -2
- package/lib/dist/effects/classes/reverbs/RoomReverb.d.ts +2 -2
- package/lib/dist/effects/classes/reverbs/RoomReverb.js +2 -2
- package/lib/dist/effects/exports.d.ts +19 -19
- package/lib/dist/effects/exports.d.ts.map +1 -1
- package/lib/dist/effects/exports.js +19 -19
- package/lib/dist/index.d.ts +12 -12
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +28 -28
- package/lib/dist/typings.d.ts +97 -59
- package/lib/dist/typings.d.ts.map +1 -1
- package/lib/dist/typings.js +30 -1
- package/lib/dist/utilities/constants.d.ts +1 -1
- package/lib/dist/utilities/constants.js +9 -9
- package/lib/dist/utilities/debugger.d.ts +7 -7
- package/lib/dist/utilities/debugger.js +49 -49
- package/lib/dist/utilities/helpers.d.ts +46 -40
- package/lib/dist/utilities/helpers.d.ts.map +1 -1
- package/lib/dist/utilities/helpers.js +186 -143
- package/lib/dist/utilities/web-assembly.d.ts +3 -3
- package/lib/dist/utilities/web-assembly.d.ts.map +1 -1
- package/lib/dist/utilities/web-assembly.js +12 -12
- package/lib/src/console-codes.ts +15 -15
- package/lib/src/core/classes/AudioClip.ts +539 -539
- package/lib/src/core/classes/AudioDevice.ts +38 -38
- package/lib/src/core/classes/Channel.ts +288 -288
- package/lib/src/core/classes/DpsPipeline.ts +152 -152
- package/lib/src/core/classes/Effector.ts +11 -12
- package/lib/src/core/classes/Master.ts +49 -49
- package/lib/src/core/exports.ts +5 -5
- package/lib/src/effects/classes/Chorus.ts +65 -111
- package/lib/src/effects/classes/Distortion.ts +13 -13
- package/lib/src/effects/classes/Saturation.ts +2 -2
- package/lib/src/effects/classes/SoftClip.ts +60 -44
- package/lib/src/effects/classes/StereoPanner.ts +2 -2
- package/lib/src/effects/classes/filters/LowPassFilter.ts +54 -0
- package/lib/src/effects/exports.ts +23 -22
- package/lib/src/index.ts +98 -93
- package/lib/src/typings.ts +113 -78
- package/lib/src/utilities/constants.ts +8 -8
- package/lib/src/utilities/debugger.ts +65 -65
- package/lib/src/utilities/helpers.ts +265 -237
- package/lib/src/utilities/web-assembly.ts +12 -12
- package/package.json +51 -50
- package/lib/dist/effects/classes/Filter.d.ts +0 -3
- package/lib/dist/effects/classes/Filter.d.ts.map +0 -1
- package/lib/dist/effects/classes/Filter.js +0 -2
- package/lib/src/effects/classes/Filter.ts +0 -1
|
@@ -1,45 +1,61 @@
|
|
|
1
|
-
import { compiledWebAssemblyModule } from "../../utilities/web-assembly";
|
|
2
|
-
import { Effector } from "../../core/classes/Effector";
|
|
3
|
-
import { Debug } from "../../utilities/debugger";
|
|
4
|
-
|
|
5
|
-
export class SoftClip extends Effector {
|
|
6
|
-
|
|
7
|
-
public label: string | null = "SoftClip";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(public drive: number = 1) {
|
|
11
|
-
super();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public async InitializeOnAttachment(parentialContext: AudioContext): Promise<void> {
|
|
15
|
-
|
|
16
|
-
if(!compiledWebAssemblyModule) return Debug.Error("Could not initialize effector because the nessecary WASM file has not been specified.", [
|
|
17
|
-
`Effector type: SoftClip`
|
|
18
|
-
]);
|
|
19
|
-
|
|
20
|
-
this.audioWorkletNode = new AudioWorkletNode(parentialContext, "SoftClipProcessor", {
|
|
21
|
-
numberOfInputs: 1,
|
|
22
|
-
numberOfOutputs: 1,
|
|
23
|
-
outputChannelCount: [2],
|
|
24
|
-
parameterData: {
|
|
25
|
-
drive: this.drive
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
import { compiledWebAssemblyModule } from "../../utilities/web-assembly";
|
|
2
|
+
import { Effector } from "../../core/classes/Effector";
|
|
3
|
+
import { Debug } from "../../utilities/debugger";
|
|
4
|
+
|
|
5
|
+
export class SoftClip extends Effector {
|
|
6
|
+
|
|
7
|
+
public label: string | null = "SoftClip";
|
|
8
|
+
public name: string = "SoftClip";
|
|
9
|
+
|
|
10
|
+
constructor(public drive: number = 1, public gain: number = 1) {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public async InitializeOnAttachment(parentialContext: AudioContext): Promise<void> {
|
|
15
|
+
|
|
16
|
+
if(!compiledWebAssemblyModule) return Debug.Error("Could not initialize effector because the nessecary WASM file has not been specified.", [
|
|
17
|
+
`Effector type: SoftClip`
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
this.audioWorkletNode = new AudioWorkletNode(parentialContext, "SoftClipProcessor", {
|
|
21
|
+
numberOfInputs: 1,
|
|
22
|
+
numberOfOutputs: 1,
|
|
23
|
+
outputChannelCount: [2],
|
|
24
|
+
parameterData: {
|
|
25
|
+
drive: this.drive,
|
|
26
|
+
gain: this.gain
|
|
27
|
+
},
|
|
28
|
+
processorOptions: {
|
|
29
|
+
module: compiledWebAssemblyModule
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
this.parentialContext = parentialContext;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public SetDrive(drive: number): SoftClip {
|
|
37
|
+
|
|
38
|
+
if(this.audioWorkletNode) this.audioWorkletNode.port.postMessage({
|
|
39
|
+
type: "set-drive",
|
|
40
|
+
value: drive
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
this.drive = drive;
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public GetDrive(): number {
|
|
48
|
+
return this.drive;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public SetGain(gain: number): SoftClip {
|
|
52
|
+
|
|
53
|
+
if(this.audioWorkletNode) this.audioWorkletNode.port.postMessage({
|
|
54
|
+
type: "set-gain",
|
|
55
|
+
value: gain
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
this.gain = gain;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
45
61
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export class StereoPanner {
|
|
2
|
-
|
|
1
|
+
export class StereoPanner {
|
|
2
|
+
public name: string = "StereoPanner";
|
|
3
3
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Effector } from "../../../core/classes/Effector";
|
|
2
|
+
|
|
3
|
+
import { SendMessageToWorklet, CreateAudioWorkletNode } from "../../../utilities/helpers";
|
|
4
|
+
|
|
5
|
+
import { LowPassFilterOptions, LowPassFilterMessageCommandId, AudioWorkletProcessorNames } from "../../../typings";
|
|
6
|
+
|
|
7
|
+
export class LowPassFilter extends Effector {
|
|
8
|
+
|
|
9
|
+
public name: string = "LowPassFilter";
|
|
10
|
+
public label: string | null = "LowPassFilter";
|
|
11
|
+
|
|
12
|
+
public cutoff: number = 4000;
|
|
13
|
+
public minFrequency: number = 10;
|
|
14
|
+
|
|
15
|
+
constructor({ cutoff, minFrequency }: LowPassFilterOptions) {
|
|
16
|
+
super();
|
|
17
|
+
|
|
18
|
+
this.cutoff = cutoff ?? this.cutoff;
|
|
19
|
+
this.minFrequency = minFrequency ?? this.minFrequency;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public async InitializeOnAttachment(parentialContext: AudioContext): Promise<void> {
|
|
23
|
+
|
|
24
|
+
this.parentialContext = parentialContext;
|
|
25
|
+
this.audioWorkletNode = CreateAudioWorkletNode(parentialContext, AudioWorkletProcessorNames.LowPassFilter, this.ReturnOptionsAsObject());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public ReturnOptionsAsObject(): LowPassFilterOptions {
|
|
29
|
+
return {
|
|
30
|
+
cutoff: this.cutoff,
|
|
31
|
+
minFrequency: this.minFrequency
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public SetCutoff(cutoff: number = 4000): boolean {
|
|
36
|
+
|
|
37
|
+
if (!this.parentialContext) return false;
|
|
38
|
+
|
|
39
|
+
if (cutoff >= this.parentialContext.sampleRate)
|
|
40
|
+
cutoff = this.parentialContext.sampleRate;
|
|
41
|
+
|
|
42
|
+
this.cutoff = cutoff;
|
|
43
|
+
return SendMessageToWorklet<LowPassFilterMessageCommandId, number>(this.audioWorkletNode, LowPassFilterMessageCommandId.SetCutoff, cutoff);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public SetMinFrequency(minFrequency: number = 10): boolean {
|
|
47
|
+
|
|
48
|
+
if (minFrequency < 10)
|
|
49
|
+
minFrequency = 10;
|
|
50
|
+
|
|
51
|
+
this.minFrequency = minFrequency;
|
|
52
|
+
return SendMessageToWorklet<LowPassFilterMessageCommandId, number>(this.audioWorkletNode, LowPassFilterMessageCommandId.SetMinFrequency, minFrequency);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
export { Chorus } from "./classes/Chorus";
|
|
2
|
-
export { Distortion } from "./classes/Distortion";
|
|
3
|
-
export { Equalizer } from "./classes/Equalizer";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
|
|
1
|
+
export { Chorus } from "./classes/Chorus";
|
|
2
|
+
export { Distortion } from "./classes/Distortion";
|
|
3
|
+
export { Equalizer } from "./classes/Equalizer";
|
|
4
|
+
export { Limiter } from "./classes/Limiter";
|
|
5
|
+
export { Saturation } from "./classes/Saturation";
|
|
6
|
+
export { StereoPanner } from "./classes/StereoPanner";
|
|
7
|
+
export { SoftClip } from "./classes/SoftClip";
|
|
8
|
+
|
|
9
|
+
export { Compressor } from "./classes/compressors/Compressor";
|
|
10
|
+
export { MultibandCompressor } from "./classes/compressors/MultibandCompressor";
|
|
11
|
+
|
|
12
|
+
export { AdvancedDelay } from "./classes/delays/AdvancedDelay";
|
|
13
|
+
export { MonoDelay } from "./classes/delays/MonoDelay";
|
|
14
|
+
export { PingPongDelay } from "./classes/delays/PingPongDelay";
|
|
15
|
+
export { StereoDelay } from "./classes/delays/StereoDelay";
|
|
16
|
+
|
|
17
|
+
export { ChamberReverb } from "./classes/reverbs/ChamberReverb";
|
|
18
|
+
export { ConvolverReverb } from "./classes/reverbs/ConvolverReverb";
|
|
19
|
+
export { GenericReverb } from "./classes/reverbs/GenericReverb";
|
|
20
|
+
export { HallReverb } from "./classes/reverbs/HallReverb";
|
|
21
|
+
export { RoomReverb } from "./classes/reverbs/RoomReverb";
|
|
22
|
+
|
|
23
|
+
export { LowPassFilter } from "./classes/filters/LowPassFilter";
|
package/lib/src/index.ts
CHANGED
|
@@ -1,94 +1,99 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FluexGL Audio
|
|
3
|
-
* A javascript digital audio processor library.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { FluexGLAudioDescriptor } from "./typings";
|
|
7
|
-
|
|
8
|
-
export const FluexGLAudio: FluexGLAudioDescriptor = {
|
|
9
|
-
name: "FluexGL Audio",
|
|
10
|
-
author: "Rohan Kanhaisingh",
|
|
11
|
-
version: "0.0.2",
|
|
12
|
-
license: "MIT",
|
|
13
|
-
repository: "https://github.com/rohankanhaisingh/FluexGL-Audio",
|
|
14
|
-
options: {
|
|
15
|
-
maxMasterChannels: 8,
|
|
16
|
-
maxTotalChannels: 128,
|
|
17
|
-
sampleRate: 44000,
|
|
18
|
-
spatialization: "stereo",
|
|
19
|
-
debugger: {
|
|
20
|
-
showErrors: true,
|
|
21
|
-
showInfo: true,
|
|
22
|
-
showWarnings: true,
|
|
23
|
-
breakOnError: true
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
Chorus,
|
|
30
|
-
Distortion,
|
|
31
|
-
Equalizer,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} from "./effects/exports";
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
AudioDevice,
|
|
52
|
-
Channel,
|
|
53
|
-
Effector,
|
|
54
|
-
Master,
|
|
55
|
-
AudioClip,
|
|
56
|
-
DspPipeline
|
|
57
|
-
} from "./core/exports";
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
InitializeDspPipeline,
|
|
61
|
-
ResolveAudioOutputDevices,
|
|
62
|
-
ResolveAudioInputDevices,
|
|
63
|
-
ResolveDefaultAudioInputDevice,
|
|
64
|
-
ResolveDefaultAudioOutputDevice,
|
|
65
|
-
LoadAudioSource,
|
|
66
|
-
LoadAudioSourceFromBlob,
|
|
67
|
-
LoadWorkletOnMasterChannel,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
/**
|
|
2
|
+
* FluexGL Audio
|
|
3
|
+
* A javascript digital audio processor library.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { FluexGLAudioDescriptor } from "./typings";
|
|
7
|
+
|
|
8
|
+
export const FluexGLAudio: FluexGLAudioDescriptor = {
|
|
9
|
+
name: "FluexGL Audio",
|
|
10
|
+
author: "Rohan Kanhaisingh",
|
|
11
|
+
version: "0.0.2",
|
|
12
|
+
license: "MIT",
|
|
13
|
+
repository: "https://github.com/rohankanhaisingh/FluexGL-Audio",
|
|
14
|
+
options: {
|
|
15
|
+
maxMasterChannels: 8,
|
|
16
|
+
maxTotalChannels: 128,
|
|
17
|
+
sampleRate: 44000,
|
|
18
|
+
spatialization: "stereo",
|
|
19
|
+
debugger: {
|
|
20
|
+
showErrors: true,
|
|
21
|
+
showInfo: true,
|
|
22
|
+
showWarnings: true,
|
|
23
|
+
breakOnError: true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
Chorus,
|
|
30
|
+
Distortion,
|
|
31
|
+
Equalizer,
|
|
32
|
+
Limiter,
|
|
33
|
+
Saturation,
|
|
34
|
+
StereoPanner,
|
|
35
|
+
Compressor,
|
|
36
|
+
MultibandCompressor,
|
|
37
|
+
AdvancedDelay,
|
|
38
|
+
MonoDelay,
|
|
39
|
+
PingPongDelay,
|
|
40
|
+
StereoDelay,
|
|
41
|
+
ChamberReverb,
|
|
42
|
+
ConvolverReverb,
|
|
43
|
+
GenericReverb,
|
|
44
|
+
HallReverb,
|
|
45
|
+
RoomReverb,
|
|
46
|
+
SoftClip,
|
|
47
|
+
LowPassFilter
|
|
48
|
+
} from "./effects/exports";
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
AudioDevice,
|
|
52
|
+
Channel,
|
|
53
|
+
Effector,
|
|
54
|
+
Master,
|
|
55
|
+
AudioClip,
|
|
56
|
+
DspPipeline
|
|
57
|
+
} from "./core/exports";
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
InitializeDspPipeline,
|
|
61
|
+
ResolveAudioOutputDevices,
|
|
62
|
+
ResolveAudioInputDevices,
|
|
63
|
+
ResolveDefaultAudioInputDevice,
|
|
64
|
+
ResolveDefaultAudioOutputDevice,
|
|
65
|
+
LoadAudioSource,
|
|
66
|
+
LoadAudioSourceFromBlob,
|
|
67
|
+
LoadWorkletOnMasterChannel,
|
|
68
|
+
SendMessageToWorklet
|
|
69
|
+
} from "./utilities/helpers";
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
SUPPORTED_FILE_TYPES
|
|
73
|
+
} from "./utilities/constants";
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
hasInitializedWasm,
|
|
77
|
+
} from "./utilities/web-assembly";
|
|
78
|
+
|
|
79
|
+
export type {
|
|
80
|
+
FluexGLAudioDescriptor,
|
|
81
|
+
FluexGLAudioDebuggerOptions,
|
|
82
|
+
FluexGLAudioOptions,
|
|
83
|
+
LoadAudioSourceOptions,
|
|
84
|
+
AudioSourceData,
|
|
85
|
+
ChannelOptions,
|
|
86
|
+
ChannelSpatialization,
|
|
87
|
+
AudioClipEventMap,
|
|
88
|
+
AudioClipEvents,
|
|
89
|
+
AudioClipOnProgressEvent,
|
|
90
|
+
AudioClipAnalyserProperty,
|
|
91
|
+
AudioClipAnalyserType,
|
|
92
|
+
DspPipelineInitializationOptions,
|
|
93
|
+
DspPipelineInitializationState,
|
|
94
|
+
ChorusEffectOptions,
|
|
95
|
+
LowPassFilterOptions,
|
|
96
|
+
LowPassFilterMessageCommandId,
|
|
97
|
+
ChorusMessageCommandId,
|
|
98
|
+
AudioWorkletProcessorNames
|
|
94
99
|
} from "./typings";
|
package/lib/src/typings.ts
CHANGED
|
@@ -1,79 +1,114 @@
|
|
|
1
|
-
export type ChannelSpatialization = "mono" | "stereo" | "surround";
|
|
2
|
-
|
|
3
|
-
export type AudioClipAnalyserType = "pre" | "post";
|
|
4
|
-
export type AudioClipAnalyserProperty = "fftSize" | "minDecibels" | "maxDecibels" | "smoothingTimeConstant";
|
|
5
|
-
|
|
6
|
-
export type AudioClipEvents = {
|
|
7
|
-
[K in keyof AudioClipEventMap]: AudioClipEventMap[K][];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
export type ChannelSpatialization = "mono" | "stereo" | "surround";
|
|
2
|
+
|
|
3
|
+
export type AudioClipAnalyserType = "pre" | "post";
|
|
4
|
+
export type AudioClipAnalyserProperty = "fftSize" | "minDecibels" | "maxDecibels" | "smoothingTimeConstant";
|
|
5
|
+
|
|
6
|
+
export type AudioClipEvents = {
|
|
7
|
+
[K in keyof AudioClipEventMap]: AudioClipEventMap[K][];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum LowPassFilterMessageCommandId {
|
|
11
|
+
SetCutoff,
|
|
12
|
+
SetMinFrequency
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum ChorusMessageCommandId {
|
|
16
|
+
SetBaseDelayMs,
|
|
17
|
+
SetDepthMs,
|
|
18
|
+
SetRateHz,
|
|
19
|
+
SetMix,
|
|
20
|
+
SetFeedback
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum AudioWorkletProcessorNames {
|
|
24
|
+
Compressor = "CompressorProcessor",
|
|
25
|
+
MultibandCompressor = "MultibandCompressorProcessor",
|
|
26
|
+
AdvancedDelay = "AdvancedDelayProcessor",
|
|
27
|
+
MonoDelay = "MonoDelayProcessor",
|
|
28
|
+
PingPongDelay = "PingPongDelayProcessor",
|
|
29
|
+
StereoDelay = "StereoDelayProcessor",
|
|
30
|
+
LowPassFilter = "LowPassFilterProcessor",
|
|
31
|
+
HighPassFilter = "HighPassFilterProcessor",
|
|
32
|
+
BandPassFilter = "BandPassFilterProcessor",
|
|
33
|
+
NotchFilter = "NotchFilterProcessor",
|
|
34
|
+
Chorus = "ChorusProcessor",
|
|
35
|
+
Flanger = "FlangerProcessor",
|
|
36
|
+
Phaser = "PhaserProcessor",
|
|
37
|
+
Reverb = "ReverbProcessor"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface FluexGLAudioDebuggerOptions {
|
|
41
|
+
breakOnError: boolean;
|
|
42
|
+
showInfo: boolean;
|
|
43
|
+
showErrors: boolean;
|
|
44
|
+
showWarnings: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface FluexGLAudioOptions {
|
|
48
|
+
maxMasterChannels: number;
|
|
49
|
+
maxTotalChannels: number;
|
|
50
|
+
sampleRate: number;
|
|
51
|
+
spatialization: ChannelSpatialization;
|
|
52
|
+
debugger: FluexGLAudioDebuggerOptions;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface FluexGLAudioDescriptor {
|
|
56
|
+
name: string;
|
|
57
|
+
author: string;
|
|
58
|
+
version: string;
|
|
59
|
+
license: string;
|
|
60
|
+
repository: string;
|
|
61
|
+
options: FluexGLAudioOptions;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface LoadAudioSourceOptions {
|
|
65
|
+
allowForeignFileTypes: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface AudioSourceData {
|
|
69
|
+
arrayBuffer: ArrayBuffer;
|
|
70
|
+
audioBuffer: AudioBuffer;
|
|
71
|
+
id: string;
|
|
72
|
+
timestamp: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ChannelOptions {
|
|
76
|
+
label: string | null;
|
|
77
|
+
maxAudioNodes: number;
|
|
78
|
+
maxEffects: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface AudioClipOnProgressEvent {
|
|
82
|
+
startTime: number;
|
|
83
|
+
offset: number;
|
|
84
|
+
current: number;
|
|
85
|
+
contextTimestamp: number;
|
|
86
|
+
formatted: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface AudioClipEventMap {
|
|
90
|
+
"progress": (event: AudioClipOnProgressEvent) => void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface DspPipelineInitializationOptions {
|
|
94
|
+
pathToWasm: string;
|
|
95
|
+
pathToWorklet: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface DspPipelineInitializationState {
|
|
99
|
+
success: boolean;
|
|
100
|
+
workletBlobUrl: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface ChorusEffectOptions {
|
|
104
|
+
baseDelayMs: number;
|
|
105
|
+
depthMs: number;
|
|
106
|
+
rateHz: number;
|
|
107
|
+
mix: number;
|
|
108
|
+
feedback: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface LowPassFilterOptions {
|
|
112
|
+
cutoff?: number;
|
|
113
|
+
minFrequency?: number;
|
|
79
114
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const SUPPORTED_FILE_TYPES: string[] = [
|
|
2
|
-
"audio/aac",
|
|
3
|
-
"audio/mp3",
|
|
4
|
-
"audio/mpeg",
|
|
5
|
-
"audio/ogg",
|
|
6
|
-
"audio/wav",
|
|
7
|
-
"audio/wave",
|
|
8
|
-
"audio/webm"
|
|
1
|
+
export const SUPPORTED_FILE_TYPES: string[] = [
|
|
2
|
+
"audio/aac",
|
|
3
|
+
"audio/mp3",
|
|
4
|
+
"audio/mpeg",
|
|
5
|
+
"audio/ogg",
|
|
6
|
+
"audio/wav",
|
|
7
|
+
"audio/wave",
|
|
8
|
+
"audio/webm"
|
|
9
9
|
];
|