xsound 2.27.0 → 3.0.0-alpha
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 +57 -29
- package/build/types/AudioModule/index.d.ts +198 -0
- package/build/types/AudioModule/index.d.ts.map +1 -0
- package/build/types/MIDI/index.d.ts +48 -0
- package/build/types/MIDI/index.d.ts.map +1 -0
- package/build/types/MML/Part.d.ts +78 -0
- package/build/types/MML/Part.d.ts.map +1 -0
- package/build/types/MML/Sequence.d.ts +66 -0
- package/build/types/MML/Sequence.d.ts.map +1 -0
- package/build/types/MML/Sequencer.d.ts +34 -0
- package/build/types/MML/Sequencer.d.ts.map +1 -0
- package/build/types/MML/Token.d.ts +40 -0
- package/build/types/MML/Token.d.ts.map +1 -0
- package/build/types/MML/Tokenizer.d.ts +21 -0
- package/build/types/MML/Tokenizer.d.ts.map +1 -0
- package/build/types/MML/Tree.d.ts +60 -0
- package/build/types/MML/Tree.d.ts.map +1 -0
- package/build/types/MML/TreeConstructor.d.ts +25 -0
- package/build/types/MML/TreeConstructor.d.ts.map +1 -0
- package/build/types/MML/index.d.ts +115 -0
- package/build/types/MML/index.d.ts.map +1 -0
- package/build/types/MediaModule/index.d.ts +223 -0
- package/build/types/MediaModule/index.d.ts.map +1 -0
- package/build/types/MixerModule/index.d.ts +99 -0
- package/build/types/MixerModule/index.d.ts.map +1 -0
- package/build/types/NoiseModule/index.d.ts +106 -0
- package/build/types/NoiseModule/index.d.ts.map +1 -0
- package/build/types/OneshotModule/index.d.ts +176 -0
- package/build/types/OneshotModule/index.d.ts.map +1 -0
- package/build/types/OscillatorModule/Glide.d.ts +47 -0
- package/build/types/OscillatorModule/Glide.d.ts.map +1 -0
- package/build/types/OscillatorModule/Oscillator.d.ts +77 -0
- package/build/types/OscillatorModule/Oscillator.d.ts.map +1 -0
- package/build/types/OscillatorModule/index.d.ts +138 -0
- package/build/types/OscillatorModule/index.d.ts.map +1 -0
- package/build/types/ProcessorModule/index.d.ts +124 -0
- package/build/types/ProcessorModule/index.d.ts.map +1 -0
- package/build/types/SoundModule/Analyser/FFT.d.ts +61 -0
- package/build/types/SoundModule/Analyser/FFT.d.ts.map +1 -0
- package/build/types/SoundModule/Analyser/Time.d.ts +54 -0
- package/build/types/SoundModule/Analyser/Time.d.ts.map +1 -0
- package/build/types/SoundModule/Analyser/TimeOverview.d.ts +132 -0
- package/build/types/SoundModule/Analyser/TimeOverview.d.ts.map +1 -0
- package/build/types/SoundModule/Analyser/Visualizer.d.ts +150 -0
- package/build/types/SoundModule/Analyser/Visualizer.d.ts.map +1 -0
- package/build/types/SoundModule/Analyser/index.d.ts +85 -0
- package/build/types/SoundModule/Analyser/index.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Autopanner.d.ts +39 -0
- package/build/types/SoundModule/Effectors/Autopanner.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Chorus.d.ts +51 -0
- package/build/types/SoundModule/Effectors/Chorus.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Compressor.d.ts +43 -0
- package/build/types/SoundModule/Effectors/Compressor.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Delay.d.ts +48 -0
- package/build/types/SoundModule/Effectors/Delay.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Distortion.d.ts +90 -0
- package/build/types/SoundModule/Effectors/Distortion.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Effector.d.ts +79 -0
- package/build/types/SoundModule/Effectors/Effector.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/EnvelopeGenerator.d.ts +90 -0
- package/build/types/SoundModule/Effectors/EnvelopeGenerator.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Equalizer.d.ts +44 -0
- package/build/types/SoundModule/Effectors/Equalizer.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Filter.d.ts +61 -0
- package/build/types/SoundModule/Effectors/Filter.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Flanger.d.ts +51 -0
- package/build/types/SoundModule/Effectors/Flanger.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Listener.d.ts +47 -0
- package/build/types/SoundModule/Effectors/Listener.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Panner.d.ts +68 -0
- package/build/types/SoundModule/Effectors/Panner.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Phaser.d.ts +55 -0
- package/build/types/SoundModule/Effectors/Phaser.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/PitchShifter.d.ts +42 -0
- package/build/types/SoundModule/Effectors/PitchShifter.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Reverb.d.ts +81 -0
- package/build/types/SoundModule/Effectors/Reverb.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Ringmodulator.d.ts +39 -0
- package/build/types/SoundModule/Effectors/Ringmodulator.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Stereo.d.ts +45 -0
- package/build/types/SoundModule/Effectors/Stereo.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Tremolo.d.ts +41 -0
- package/build/types/SoundModule/Effectors/Tremolo.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/VocalCanceler.d.ts +31 -0
- package/build/types/SoundModule/Effectors/VocalCanceler.d.ts.map +1 -0
- package/build/types/SoundModule/Effectors/Wah.d.ts +49 -0
- package/build/types/SoundModule/Effectors/Wah.d.ts.map +1 -0
- package/build/types/SoundModule/Recorder/Channel.d.ts +44 -0
- package/build/types/SoundModule/Recorder/Channel.d.ts.map +1 -0
- package/build/types/SoundModule/Recorder/Track.d.ts +36 -0
- package/build/types/SoundModule/Recorder/Track.d.ts.map +1 -0
- package/build/types/SoundModule/Recorder/index.d.ts +118 -0
- package/build/types/SoundModule/Recorder/index.d.ts.map +1 -0
- package/build/types/SoundModule/Session/Room.d.ts +69 -0
- package/build/types/SoundModule/Session/Room.d.ts.map +1 -0
- package/build/types/SoundModule/Session/index.d.ts +94 -0
- package/build/types/SoundModule/Session/index.d.ts.map +1 -0
- package/build/types/SoundModule/index.d.ts +147 -0
- package/build/types/SoundModule/index.d.ts.map +1 -0
- package/build/types/StreamModule/NoiseGate.d.ts +29 -0
- package/build/types/StreamModule/NoiseGate.d.ts.map +1 -0
- package/build/types/StreamModule/NoiseSuppressor.d.ts +30 -0
- package/build/types/StreamModule/NoiseSuppressor.d.ts.map +1 -0
- package/build/types/StreamModule/index.d.ts +175 -0
- package/build/types/StreamModule/index.d.ts.map +1 -0
- package/build/types/XSound/index.d.ts +155 -0
- package/build/types/XSound/index.d.ts.map +1 -0
- package/build/types/interfaces.d.ts +23 -0
- package/build/types/interfaces.d.ts.map +1 -0
- package/build/types/main.d.ts +117 -0
- package/build/types/main.d.ts.map +1 -0
- package/build/types/types.d.ts +10 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/xsound.js +1 -1
- package/build/xsound.js.LICENSE.txt +1 -1
- package/build/xsound.js.map +1 -1
- package/build/xsound.min.js +3 -0
- package/build/xsound.min.js.LICENSE.txt +1 -0
- package/build/xsound.min.js.map +1 -0
- package/package.json +38 -33
- package/build/xsound.d.ts +0 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Connectable } from '../../interfaces';
|
|
2
|
+
import { BufferSize } from '../../types';
|
|
3
|
+
import { Analyser } from '../Analyser';
|
|
4
|
+
import { NumberOfSessionChannels, SessionParams } from './';
|
|
5
|
+
export declare type RoomMap = {
|
|
6
|
+
[id: string]: WebSocket | null;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* This class is entity for room feature in session.
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
export declare class Room implements Connectable {
|
|
13
|
+
private static BUFFER_SIZE;
|
|
14
|
+
private id;
|
|
15
|
+
private context;
|
|
16
|
+
private analyser;
|
|
17
|
+
private sender;
|
|
18
|
+
private receiver;
|
|
19
|
+
private websocket;
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} id This argument is string that identifies messaging room.
|
|
22
|
+
* @param {AudioContext} context This argument is in order to use interfaces of Web Audio API.
|
|
23
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
24
|
+
* @param {NumberOfSessionChannels} numberOfInputs This argument is the number of inputs for `ScriptProcessorNode`.
|
|
25
|
+
* @param {NumberOfSessionChannels} numberOfOutputs This argument the number of outputs for `ScriptProcessorNode`.
|
|
26
|
+
* @param {Analyser} analyser This argument is instance of `Analyser`.
|
|
27
|
+
*/
|
|
28
|
+
constructor(id: string, context: AudioContext, bufferSize: BufferSize, numberOfInputs: NumberOfSessionChannels, numberOfOutputs: NumberOfSessionChannels, analyser: Analyser);
|
|
29
|
+
/**
|
|
30
|
+
* This method creates instance of `WebSocket` and registers event handlers. Namely, join room.
|
|
31
|
+
* @param {SessionParams} params This argument is in order to create instance of `WebSocket`.
|
|
32
|
+
*/
|
|
33
|
+
join(params: SessionParams): void;
|
|
34
|
+
/**
|
|
35
|
+
* This method sends sound Room ID and data (as `Float32Array`) to server.
|
|
36
|
+
*/
|
|
37
|
+
send(): void;
|
|
38
|
+
/**
|
|
39
|
+
* This method stops sending and receiving data by disconnecting `AudioNode`.
|
|
40
|
+
* Namely, leave room temporarily.
|
|
41
|
+
*/
|
|
42
|
+
leave(): void;
|
|
43
|
+
/**
|
|
44
|
+
* This method closes connection to WebSocket server and destroys instance of `WebSocket`.
|
|
45
|
+
* Namely, leave room permanently.
|
|
46
|
+
*/
|
|
47
|
+
destroy(): void;
|
|
48
|
+
/**
|
|
49
|
+
* This method connects `AudioNode`s for receiving data.
|
|
50
|
+
*/
|
|
51
|
+
connect(): void;
|
|
52
|
+
/**
|
|
53
|
+
* This method determines whether there is connection to server.
|
|
54
|
+
* @return {boolean} If connection to server exists, this value is `true`. Otherwise, this value is `false`.
|
|
55
|
+
*/
|
|
56
|
+
connected(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* This method gets instance of `WebSocket` that corresponds Room ID.
|
|
59
|
+
* @return {RoomMap}
|
|
60
|
+
*/
|
|
61
|
+
get(): RoomMap;
|
|
62
|
+
/** @override */
|
|
63
|
+
get INPUT(): ScriptProcessorNode;
|
|
64
|
+
/** @override */
|
|
65
|
+
get OUTPUT(): ScriptProcessorNode;
|
|
66
|
+
/** @override */
|
|
67
|
+
toString(): string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Session/Room.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAE5D,oBAAY,OAAO,GAAG;IACpB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;CAC/B,CAAC;AAEF;;;GAGG;AACH,qBAAa,IAAK,YAAW,WAAW;IAEtC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAQ;IAElC,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAW;IAE3B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,QAAQ,CAAsB;IAEtC,OAAO,CAAC,SAAS,CAA0B;IAE3C;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,uBAAuB,EAAE,eAAe,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ;IAU5K;;;OAGG;IACI,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAsExC;;OAEG;IACI,IAAI,IAAI,IAAI;IA+BnB;;;OAGG;IACI,KAAK,IAAI,IAAI;IASpB;;;OAGG;IACI,OAAO,IAAI,IAAI;IAWtB;;OAEG;IACI,OAAO,IAAI,IAAI;IAQtB;;;OAGG;IACI,SAAS,IAAI,OAAO;IAI3B;;;OAGG;IACI,GAAG,IAAI,OAAO;IAIrB,gBAAgB;IAChB,IAAW,KAAK,IAAI,mBAAmB,CAEtC;IAED,gBAAgB;IAChB,IAAW,MAAM,IAAI,mBAAmB,CAEvC;IAED,gBAAgB;IACT,QAAQ,IAAI,MAAM;CAG1B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Connectable } from '../../interfaces';
|
|
2
|
+
import { BufferSize } from '../../types';
|
|
3
|
+
import { Analyser } from '../Analyser';
|
|
4
|
+
import { Room } from './Room';
|
|
5
|
+
export declare type NumberOfSessionChannels = 1 | 2;
|
|
6
|
+
/**
|
|
7
|
+
* @property {boolean} tls This argument is in order to select protocol (either `wss` or `ws`).
|
|
8
|
+
* @property {string} host This argument is server's hostname.
|
|
9
|
+
* @property {number} port This argument is port number for connection.
|
|
10
|
+
* @property {string} path This argument is script path that is executed in server side.
|
|
11
|
+
* @property {function} openCallback This argument is invoked as `onopen` event handler in instance of `WebSocket`.
|
|
12
|
+
* @property {function} closeCallback This argument is invoked as `onclose` event handler in instance of `WebSocket`.
|
|
13
|
+
* @property {function} errorCallback This argument is invoked as `onerror` event handler in instance of `WebSocket`.
|
|
14
|
+
*/
|
|
15
|
+
export declare type SessionParams = {
|
|
16
|
+
tls: boolean;
|
|
17
|
+
host: string;
|
|
18
|
+
port: number;
|
|
19
|
+
path: string;
|
|
20
|
+
openCallback?(event: Event): void;
|
|
21
|
+
closeCallback?(event: Event): void;
|
|
22
|
+
errorCallback?(event: Event): void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* This private class manages sound session rooms.
|
|
26
|
+
* @constructor
|
|
27
|
+
*/
|
|
28
|
+
export declare class Session implements Connectable {
|
|
29
|
+
private context;
|
|
30
|
+
private input;
|
|
31
|
+
private output;
|
|
32
|
+
private rooms;
|
|
33
|
+
/**
|
|
34
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
35
|
+
*/
|
|
36
|
+
constructor(context: AudioContext);
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
39
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
40
|
+
* @param {NumberOfSessionChannels} numberOfInputs This argument is the number of inputs for `ScriptProcessorNode`.
|
|
41
|
+
* @param {NumberOfSessionChannels} numberOfOutputs This argument the number of outputs for `ScriptProcessorNode`.
|
|
42
|
+
* @param {Analyser} analyser This argument is instance of `Analyser`.
|
|
43
|
+
* @return {Session} Return value is for method chain.
|
|
44
|
+
*/
|
|
45
|
+
setup(roomId: string, bufferSize: BufferSize, numberOfInputs: NumberOfSessionChannels, numberOfOutputs: NumberOfSessionChannels, analyser: Analyser): Session;
|
|
46
|
+
/**
|
|
47
|
+
* This method creates instance of `Room`
|
|
48
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
49
|
+
* @param {SessionParams} params This argument is in order to create instance of `WebSocket`.
|
|
50
|
+
* @return {Session} Return value is for method chain.
|
|
51
|
+
*/
|
|
52
|
+
ready(roomId: string, params: SessionParams): Session;
|
|
53
|
+
/**
|
|
54
|
+
* This method sends sound data to server.
|
|
55
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
56
|
+
* @return {Session} Return value is for method chain.
|
|
57
|
+
*/
|
|
58
|
+
start(roomId: string): Session;
|
|
59
|
+
/**
|
|
60
|
+
* This method stops sending and receiving data.
|
|
61
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
62
|
+
* @return {Session} Return value is for method chain.
|
|
63
|
+
*/
|
|
64
|
+
stop(roomId: string): Session;
|
|
65
|
+
/**
|
|
66
|
+
* This method closes connection to WebSocket server and destroys instance of `WebSocket`.
|
|
67
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
68
|
+
* @return {Session} Return value is for method chain.
|
|
69
|
+
*/
|
|
70
|
+
destroy(roomId: string): Session;
|
|
71
|
+
/**
|
|
72
|
+
* This method connects `AudioNode`s.
|
|
73
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
74
|
+
* @return {Session} Return value is for method chain.
|
|
75
|
+
*/
|
|
76
|
+
connect(roomId: string): Session;
|
|
77
|
+
/**
|
|
78
|
+
* This method determines whether there is connection to server.
|
|
79
|
+
* @param {string} roomId This argument is string that identifies messaging room.
|
|
80
|
+
* @return {boolean}
|
|
81
|
+
*/
|
|
82
|
+
connected(roomId: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* This method gets instance of `Room` that is designated Room ID.
|
|
85
|
+
* @param {string} roomId This argument is string that identifies room.
|
|
86
|
+
* @return {Room}
|
|
87
|
+
*/
|
|
88
|
+
get(roomId: string): Room | null;
|
|
89
|
+
/** @override */
|
|
90
|
+
get INPUT(): GainNode;
|
|
91
|
+
/** @override */
|
|
92
|
+
get OUTPUT(): GainNode;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,oBAAY,uBAAuB,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5C;;;;;;;;GAQG;AACH,oBAAY,aAAa,GAAG;IAC1B,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,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ufferSize } from '../types';
|
|
3
|
+
import { Analyser } from './Analyser';
|
|
4
|
+
import { Recorder } from './Recorder';
|
|
5
|
+
import { Session } from './Session';
|
|
6
|
+
import { Effector } from './Effectors/Effector';
|
|
7
|
+
import { Autopanner, AutopannerParams } from './Effectors/Autopanner';
|
|
8
|
+
import { Chorus, ChorusParams } from './Effectors/Chorus';
|
|
9
|
+
import { Compressor, CompressorParams } from './Effectors/Compressor';
|
|
10
|
+
import { Delay, DelayParams } from './Effectors/Delay';
|
|
11
|
+
import { Distortion, DistortionParams } from './Effectors/Distortion';
|
|
12
|
+
import { EnvelopeGenerator, EnvelopeGeneratorParams } from './Effectors/EnvelopeGenerator';
|
|
13
|
+
import { Equalizer, EqualizerParams } from './Effectors/Equalizer';
|
|
14
|
+
import { Filter, FilterParams } from './Effectors/Filter';
|
|
15
|
+
import { Flanger, FlangerParams } from './Effectors/Flanger';
|
|
16
|
+
import { Listener, ListenerParams } from './Effectors/Listener';
|
|
17
|
+
import { Panner, PannerParams } from './Effectors/Panner';
|
|
18
|
+
import { Phaser, PhaserParams } from './Effectors/Phaser';
|
|
19
|
+
import { PitchShifter, PitchShifterParams } from './Effectors/PitchShifter';
|
|
20
|
+
import { Reverb, ReverbParams } from './Effectors/Reverb';
|
|
21
|
+
import { Ringmodulator, RingmodulatorParams } from './Effectors/Ringmodulator';
|
|
22
|
+
import { Stereo, StereoParams } from './Effectors/Stereo';
|
|
23
|
+
import { Tremolo, TremoloParams } from './Effectors/Tremolo';
|
|
24
|
+
import { Wah, WahParams } from './Effectors/Wah';
|
|
25
|
+
export declare type Module = Analyser | Recorder | Session | Stereo | Compressor | Distortion | Wah | PitchShifter | Equalizer | Filter | Autopanner | Tremolo | Ringmodulator | Phaser | Flanger | Chorus | Delay | Reverb | Panner | Listener | EnvelopeGenerator;
|
|
26
|
+
export declare type ModuleName = 'analyser' | 'recorder' | 'session' | 'autopanner' | 'chorus' | 'compressor' | 'delay' | 'distortion' | 'equalizer' | 'filter' | 'flanger' | 'listener' | 'panner' | 'phaser' | 'pitchshifter' | 'reverb' | 'ringmodulator' | 'stereo' | 'tremolo' | 'wah' | 'envelopegenerator';
|
|
27
|
+
export declare type SoundModuleParams = {
|
|
28
|
+
mastervolume: number;
|
|
29
|
+
stereo: StereoParams;
|
|
30
|
+
compressor: CompressorParams;
|
|
31
|
+
distortion: DistortionParams;
|
|
32
|
+
wah: WahParams;
|
|
33
|
+
pitchshifter: PitchShifterParams;
|
|
34
|
+
equalizer: EqualizerParams;
|
|
35
|
+
filter: FilterParams;
|
|
36
|
+
autopanner: AutopannerParams;
|
|
37
|
+
tremolo: TremoloParams;
|
|
38
|
+
ringmodulator: RingmodulatorParams;
|
|
39
|
+
phaser: PhaserParams;
|
|
40
|
+
flanger: FlangerParams;
|
|
41
|
+
chorus: ChorusParams;
|
|
42
|
+
delay: DelayParams;
|
|
43
|
+
reverb: ReverbParams;
|
|
44
|
+
panner: PannerParams;
|
|
45
|
+
listener: ListenerParams;
|
|
46
|
+
envelopegenerator: EnvelopeGeneratorParams;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* This class is superclass that is the top in this library.
|
|
50
|
+
* This class is extended as subclass (`OscillatorModule`, `OneshotModule`, `NoiseModule`, `AudioModule`, `MediaModule`, `StreamModule`, `ProcessorModule`, `MixerModule` ...etc).
|
|
51
|
+
* @constructor
|
|
52
|
+
*/
|
|
53
|
+
export declare class SoundModule implements Connectable {
|
|
54
|
+
static readonly NUMBER_OF_INPUTS = 2;
|
|
55
|
+
static readonly NUMBER_OF_OUTPUTS = 2;
|
|
56
|
+
protected context: AudioContext;
|
|
57
|
+
protected modules: Connectable[];
|
|
58
|
+
protected mastervolume: GainNode;
|
|
59
|
+
protected processor: ScriptProcessorNode;
|
|
60
|
+
protected analyser: Analyser;
|
|
61
|
+
protected recorder: Recorder;
|
|
62
|
+
protected session: Session;
|
|
63
|
+
protected stereo: Stereo;
|
|
64
|
+
protected compressor: Compressor;
|
|
65
|
+
protected distortion: Distortion;
|
|
66
|
+
protected wah: Wah;
|
|
67
|
+
protected pitchshifter: PitchShifter;
|
|
68
|
+
protected equalizer: Equalizer;
|
|
69
|
+
protected filter: Filter;
|
|
70
|
+
protected autopanner: Autopanner;
|
|
71
|
+
protected tremolo: Tremolo;
|
|
72
|
+
protected ringmodulator: Ringmodulator;
|
|
73
|
+
protected phaser: Phaser;
|
|
74
|
+
protected flanger: Flanger;
|
|
75
|
+
protected chorus: Chorus;
|
|
76
|
+
protected delay: Delay;
|
|
77
|
+
protected reverb: Reverb;
|
|
78
|
+
protected panner: Panner;
|
|
79
|
+
protected listener: Listener;
|
|
80
|
+
protected envelopegenerator: EnvelopeGenerator;
|
|
81
|
+
/**
|
|
82
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
83
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
84
|
+
*/
|
|
85
|
+
constructor(context: AudioContext, bufferSize: BufferSize);
|
|
86
|
+
/**
|
|
87
|
+
* This method changes buffer size for `ScriptProcessorNode`.
|
|
88
|
+
* @param {number} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
89
|
+
* @return {SoundModule} Return value is for method chain.
|
|
90
|
+
*/
|
|
91
|
+
resize(bufferSize: BufferSize): SoundModule;
|
|
92
|
+
/**
|
|
93
|
+
* This method gets buffer size for `ScriptProcessorNode`.
|
|
94
|
+
* @return {number}
|
|
95
|
+
*/
|
|
96
|
+
getBufferSize(): number;
|
|
97
|
+
/**
|
|
98
|
+
* This method installs customized effector.
|
|
99
|
+
* @param {string} effectorName This argument selects effector.
|
|
100
|
+
* @param {Effector} effector This argument is subclass that extends `Effector` class.
|
|
101
|
+
* @return {Effector} Return value is instance of customized effector.
|
|
102
|
+
*/
|
|
103
|
+
install(effectorName: string, effector: Effector): Effector;
|
|
104
|
+
/**
|
|
105
|
+
* This method starts effectors.
|
|
106
|
+
* @param {number} startTime This argument is used for scheduling parameter.
|
|
107
|
+
* @return {SoundModule} Return value is for method chain.
|
|
108
|
+
*/
|
|
109
|
+
on(startTime?: number): SoundModule;
|
|
110
|
+
/**
|
|
111
|
+
* This method stops effectors.
|
|
112
|
+
* @param {number} stopTime This argument is used for scheduling parameter.
|
|
113
|
+
* @return {SoundModule} Return value is for method chain.
|
|
114
|
+
*/
|
|
115
|
+
off(stopTime?: number): SoundModule;
|
|
116
|
+
/**
|
|
117
|
+
* This method stops analyser, recorder and `onaudioprocess` event.
|
|
118
|
+
* @return {SoundModule} Return value is for method chain.
|
|
119
|
+
*/
|
|
120
|
+
suspend(): SoundModule;
|
|
121
|
+
/**
|
|
122
|
+
* This method gets effector's parameters as associative array.
|
|
123
|
+
* @return {SoundModuleParams}
|
|
124
|
+
*/
|
|
125
|
+
params(): SoundModuleParams;
|
|
126
|
+
/**
|
|
127
|
+
* This method gets effector's parameters as JSON.
|
|
128
|
+
* @return {string}
|
|
129
|
+
*/
|
|
130
|
+
toJSON(): string;
|
|
131
|
+
/** @override */
|
|
132
|
+
get INPUT(): ScriptProcessorNode;
|
|
133
|
+
/** @override */
|
|
134
|
+
get OUTPUT(): GainNode;
|
|
135
|
+
/**
|
|
136
|
+
* This method re-initials modules.
|
|
137
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
138
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
139
|
+
*/
|
|
140
|
+
protected init(context: AudioContext, bufferSize: BufferSize): void;
|
|
141
|
+
/**
|
|
142
|
+
* This method connects `AudioNode`s.
|
|
143
|
+
* @param {AudioNode} source This argument is `AudioNode` as sound source.
|
|
144
|
+
*/
|
|
145
|
+
protected connect(source: AudioNode): void;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SoundModule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAA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AAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C;;;OAGG;gBACS,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU;IAiDzD;;;;OAIG;IACI,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW;IAKlD;;;OAGG;IACI,aAAa,IAAI,MAAM;IAI9B;;;;;OAKG;IACI,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ;IAQlE;;;;OAIG;IACI,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW;IAgB1C;;;;OAIG;IACI,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAgB1C;;;OAGG;IACI,OAAO,IAAI,WAAW;IAW7B;;;OAGG;IACI,MAAM,IAAI,iBAAiB;IAwBlC;;;OAGG;IACI,MAAM,IAAI,MAAM;IAIvB,gBAAgB;IAChB,IAAW,KAAK,IAAI,mBAAmB,CAEtC;IAED,gBAAgB;IAChB,IAAW,MAAM,IAAI,QAAQ,CAE5B;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI;IAkEnE;;;OAGG;IACH,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAsD3C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare type NoiseGateParams = {
|
|
2
|
+
level?: number;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* This private class is for Noise Gate.
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
export declare class NoiseGate {
|
|
9
|
+
private level;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* This method detects background noise and removes this.
|
|
13
|
+
* @param {number} data This argument is amplitude (between -1 and 1).
|
|
14
|
+
* @return {number} Return value is `0` or the raw data.
|
|
15
|
+
*/
|
|
16
|
+
start(data: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* This method gets or sets parameters for noise gate.
|
|
19
|
+
* @param {keyof NoiseGateParams|NoiseGateParams} params This argument is string if getter. Otherwise, setter.
|
|
20
|
+
* @return {NoiseGateParams[keyof NoiseGateParams]} Return value is parameter for noise gate if getter.
|
|
21
|
+
*/
|
|
22
|
+
param(params: keyof NoiseGateParams | NoiseGateParams): NoiseGateParams[keyof NoiseGateParams] | void;
|
|
23
|
+
/**
|
|
24
|
+
* This method gets noise gate parameters as associative array.
|
|
25
|
+
* @return {NoiseGateParams}
|
|
26
|
+
*/
|
|
27
|
+
params(): NoiseGateParams;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=NoiseGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoiseGate.d.ts","sourceRoot":"","sources":["../../../src/StreamModule/NoiseGate.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAK;;IAMlB;;;;OAIG;IACI,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAMlC;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,MAAM,eAAe,GAAG,eAAe,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,GAAG,IAAI;IAwB5G;;;OAGG;IACI,MAAM,IAAI,eAAe;CAKjC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare type NoiseSuppressorParams = {
|
|
2
|
+
threshold?: number;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* This private class is for Noise Suppressor.
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
export declare class NoiseSuppressor {
|
|
9
|
+
private threshold;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* This method detects background noise and removes this.
|
|
13
|
+
* @param {Float32Array} inputs This argument is instance of `Float32Array` for FFT/IFFT.
|
|
14
|
+
* @param {Float32Array} outputs This argument is instance of `Float32Array` for FFT/IFFT.
|
|
15
|
+
* @param {number} size This argument is FFT/IFFT size (power of two).
|
|
16
|
+
*/
|
|
17
|
+
start(inputs: Float32Array, outputs: Float32Array, bufferSize: number): void;
|
|
18
|
+
/**
|
|
19
|
+
* This method gets or sets parameters for noise suppressor.
|
|
20
|
+
* @param {keyof NoiseSuppressorParams|NoiseSuppressorParams} params This argument is string if getter. Otherwise, setter.
|
|
21
|
+
* @return {NoiseSuppressorParams[keyof NoiseSuppressorParams]} Return value is parameter for noise suppressor if getter.
|
|
22
|
+
*/
|
|
23
|
+
param(params: keyof NoiseSuppressorParams | NoiseSuppressorParams): NoiseSuppressorParams[keyof NoiseSuppressorParams] | void;
|
|
24
|
+
/**
|
|
25
|
+
* This method gets noise suppressor parameters as associative array.
|
|
26
|
+
* @return {NoiseSuppressorParams}
|
|
27
|
+
*/
|
|
28
|
+
params(): NoiseSuppressorParams;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=NoiseSuppressor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoiseSuppressor.d.ts","sourceRoot":"","sources":["../../../src/StreamModule/NoiseSuppressor.ts"],"names":[],"mappings":"AAEA,oBAAY,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAEF;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,SAAS,CAAK;;IAMtB;;;;;OAKG;IACI,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IA2CnF;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC,MAAM,qBAAqB,CAAC,GAAG,IAAI;IA0BpI;;;OAGG;IACI,MAAM,IAAI,qBAAqB;CAKvC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { BufferSize } from '../types';
|
|
2
|
+
import { SoundModule, SoundModuleParams } from '../SoundModule';
|
|
3
|
+
import { Analyser } from '../SoundModule/Analyser';
|
|
4
|
+
import { Recorder } from '../SoundModule/Recorder';
|
|
5
|
+
import { Session } from '../SoundModule/Session';
|
|
6
|
+
import { Autopanner } from '../SoundModule/Effectors/Autopanner';
|
|
7
|
+
import { Chorus } from '../SoundModule/Effectors/Chorus';
|
|
8
|
+
import { Compressor } from '../SoundModule/Effectors/Compressor';
|
|
9
|
+
import { Delay } from '../SoundModule/Effectors/Delay';
|
|
10
|
+
import { Distortion } from '../SoundModule/Effectors/Distortion';
|
|
11
|
+
import { EnvelopeGenerator } from '../SoundModule/Effectors/EnvelopeGenerator';
|
|
12
|
+
import { Equalizer } from '../SoundModule/Effectors/Equalizer';
|
|
13
|
+
import { Filter } from '../SoundModule/Effectors/Filter';
|
|
14
|
+
import { Flanger } from '../SoundModule/Effectors/Flanger';
|
|
15
|
+
import { Listener } from '../SoundModule/Effectors/Listener';
|
|
16
|
+
import { Panner } from '../SoundModule/Effectors/Panner';
|
|
17
|
+
import { Phaser } from '../SoundModule/Effectors/Phaser';
|
|
18
|
+
import { PitchShifter } from '../SoundModule/Effectors/PitchShifter';
|
|
19
|
+
import { Reverb } from '../SoundModule/Effectors/Reverb';
|
|
20
|
+
import { Ringmodulator } from '../SoundModule/Effectors/Ringmodulator';
|
|
21
|
+
import { Stereo } from '../SoundModule/Effectors/Stereo';
|
|
22
|
+
import { Tremolo } from '../SoundModule/Effectors/Tremolo';
|
|
23
|
+
import { Wah } from '../SoundModule/Effectors/Wah';
|
|
24
|
+
import { NoiseGate, NoiseGateParams } from './NoiseGate';
|
|
25
|
+
import { NoiseSuppressor, NoiseSuppressorParams } from './NoiseSuppressor';
|
|
26
|
+
interface MediaStreamTrackAudioSourceNode extends AudioNode {
|
|
27
|
+
}
|
|
28
|
+
export type { NoiseGateParams, NoiseSuppressorParams };
|
|
29
|
+
export declare type StreamModuleParams = SoundModuleParams & {
|
|
30
|
+
noisegate: NoiseGateParams;
|
|
31
|
+
noisesuppressor: NoiseSuppressorParams;
|
|
32
|
+
output?: boolean;
|
|
33
|
+
track?: boolean;
|
|
34
|
+
};
|
|
35
|
+
declare type Params = Partial<Pick<StreamModuleParams, 'mastervolume' | 'output' | 'track'>>;
|
|
36
|
+
/**
|
|
37
|
+
* This class is for processing sound data from WebRTC.
|
|
38
|
+
* @constructor
|
|
39
|
+
* @extends {SoundModule}
|
|
40
|
+
*/
|
|
41
|
+
export declare class StreamModule extends SoundModule {
|
|
42
|
+
private sources;
|
|
43
|
+
private stream;
|
|
44
|
+
private constraints;
|
|
45
|
+
private output;
|
|
46
|
+
private track;
|
|
47
|
+
private paused;
|
|
48
|
+
private noisegate;
|
|
49
|
+
private noisesuppressor;
|
|
50
|
+
/**
|
|
51
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
52
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
53
|
+
*/
|
|
54
|
+
constructor(context: AudioContext, bufferSize: BufferSize);
|
|
55
|
+
/**
|
|
56
|
+
* This method sets up for using WebRTC.
|
|
57
|
+
* @param {MediaStreamConstraints} constraints This argument is object based on `MediaStreamConstraints` dictionary.
|
|
58
|
+
* @return {StreamModule} Return value is for method chain.
|
|
59
|
+
*/
|
|
60
|
+
setup(constraints?: MediaStreamConstraints): StreamModule;
|
|
61
|
+
/**
|
|
62
|
+
* This method opens devices or sets instance of `MediaStream`.
|
|
63
|
+
* @param {MediaStream} stream This argument is instance of `MediaStream`.
|
|
64
|
+
* @param {function} successCallback This argument is invoked on success.
|
|
65
|
+
* @param {function} errorCallback This argument is invoked on failure.
|
|
66
|
+
* @return {Promise<void>} Return value is `Promise` that `getUserMedia` returns.
|
|
67
|
+
*/
|
|
68
|
+
ready(params?: {
|
|
69
|
+
stream?: MediaStream;
|
|
70
|
+
successCallback?: (stream: MediaStream) => void;
|
|
71
|
+
errorCallback?: (error: Error) => void;
|
|
72
|
+
}): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* This method starts streaming.
|
|
75
|
+
* @return {StreamModule} Return value is for method chain.
|
|
76
|
+
*/
|
|
77
|
+
start(): StreamModule;
|
|
78
|
+
/**
|
|
79
|
+
* This method stops streaming.
|
|
80
|
+
* @return {StreamModule} Return value is for method chain.
|
|
81
|
+
*/
|
|
82
|
+
stop(): StreamModule;
|
|
83
|
+
/**
|
|
84
|
+
* This method gets or sets parameters for stream module.
|
|
85
|
+
* This method is overloaded for type interface and type check.
|
|
86
|
+
* @param {keyof Params} params This argument is string if getter. Otherwise, setter.
|
|
87
|
+
* @return {Params[keyof Params]|StreamModule} Return value is parameter for stream module if getter.
|
|
88
|
+
* Otherwise, return value is for method chain.
|
|
89
|
+
*/
|
|
90
|
+
param(params: 'mastervolume'): number;
|
|
91
|
+
param(params: 'output'): boolean;
|
|
92
|
+
param(params: 'track'): boolean;
|
|
93
|
+
param(params: Params): StreamModule;
|
|
94
|
+
/**
|
|
95
|
+
* This method gets instance of `MediaStreamAudioSourceNode` or `MediaStreamTrackAudioSourceNode` or that array contains these.
|
|
96
|
+
* This method is overloaded for type interface and type check.
|
|
97
|
+
* @param {number} index This argument selects instance of `MediaStreamAudioSourceNode` or `MediaStreamTrackAudioSourceNode`.
|
|
98
|
+
* @return {MediaStreamAudioSourceNode|MediaStreamTrackAudioSourceNode}
|
|
99
|
+
*/
|
|
100
|
+
get(index: number): MediaStreamAudioSourceNode | MediaStreamTrackAudioSourceNode;
|
|
101
|
+
get(): MediaStreamAudioSourceNode[] | MediaStreamTrackAudioSourceNode[];
|
|
102
|
+
/**
|
|
103
|
+
* This method gets instance of `MediaStream`.
|
|
104
|
+
* @return {MediaStream|null}
|
|
105
|
+
*/
|
|
106
|
+
getStream(): MediaStream | null;
|
|
107
|
+
/**
|
|
108
|
+
* This method stops microphone and camera by stopping instances of `MediaStreamTrack`.
|
|
109
|
+
* @return {StreamModule} Return value is for method chain.
|
|
110
|
+
*/
|
|
111
|
+
clear(): StreamModule;
|
|
112
|
+
/**
|
|
113
|
+
* This method stops microphone by stopping instances of `MediaStreamTrack`.
|
|
114
|
+
* @return {StreamModule} Return value is for method chain.
|
|
115
|
+
*/
|
|
116
|
+
clearAudioDevices(): StreamModule;
|
|
117
|
+
/**
|
|
118
|
+
* This method stops camera by stopping instances of `MediaStreamTrack`.
|
|
119
|
+
* @return {StreamModule} Return value is for method chain.
|
|
120
|
+
*/
|
|
121
|
+
clearVideoDevices(): StreamModule;
|
|
122
|
+
/**
|
|
123
|
+
* This method gets available devices as array that contains instance of `MediaDeviceInfo`.
|
|
124
|
+
* @return {Promise<MediaDeviceInfo[]|void>} Return value is `Promise` that has array contains instance of `MediaDeviceInfo`.
|
|
125
|
+
*/
|
|
126
|
+
devices(): Promise<MediaDeviceInfo[] | void>;
|
|
127
|
+
/**
|
|
128
|
+
* This method determines whether streaming is active.
|
|
129
|
+
* @return {boolean} If streaming is active, this value is `true`. Otherwise, this value is `false`.
|
|
130
|
+
*/
|
|
131
|
+
streaming(): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* This method gets instance of `Module` (Analyser, Recorder, Effector ... etc).
|
|
134
|
+
* @param {ModuleName|'noisegate'|'noisesuppressor'} moduleName This argument selects module.
|
|
135
|
+
* @return {Module|NoiseGate|NoiseSuppressor}
|
|
136
|
+
*/
|
|
137
|
+
module(moduleName: 'analyser'): Analyser;
|
|
138
|
+
module(moduleName: 'recorder'): Recorder;
|
|
139
|
+
module(moduleName: 'session'): Session;
|
|
140
|
+
module(moduleName: 'autopanner'): Autopanner;
|
|
141
|
+
module(moduleName: 'chorus'): Chorus;
|
|
142
|
+
module(moduleName: 'compressor'): Compressor;
|
|
143
|
+
module(moduleName: 'delay'): Delay;
|
|
144
|
+
module(moduleName: 'distortion'): Distortion;
|
|
145
|
+
module(moduleName: 'equalizer'): Equalizer;
|
|
146
|
+
module(moduleName: 'filter'): Filter;
|
|
147
|
+
module(moduleName: 'flanger'): Flanger;
|
|
148
|
+
module(moduleName: 'listener'): Listener;
|
|
149
|
+
module(moduleName: 'panner'): Panner;
|
|
150
|
+
module(moduleName: 'phaser'): Phaser;
|
|
151
|
+
module(moduleName: 'pitchshifter'): PitchShifter;
|
|
152
|
+
module(moduleName: 'reverb'): Reverb;
|
|
153
|
+
module(moduleName: 'ringmodulator'): Ringmodulator;
|
|
154
|
+
module(moduleName: 'stereo'): Stereo;
|
|
155
|
+
module(moduleName: 'tremolo'): Tremolo;
|
|
156
|
+
module(moduleName: 'wah'): Wah;
|
|
157
|
+
module(moduleName: 'envelopegenerator'): EnvelopeGenerator;
|
|
158
|
+
module(moduleName: 'noisegate'): NoiseGate;
|
|
159
|
+
module(moduleName: 'noisesuppressor'): NoiseSuppressor;
|
|
160
|
+
/** @override */
|
|
161
|
+
resize(bufferSize: BufferSize): StreamModule;
|
|
162
|
+
/** @override */
|
|
163
|
+
on(startTime?: number): StreamModule;
|
|
164
|
+
/** @override */
|
|
165
|
+
off(stopTime?: number): StreamModule;
|
|
166
|
+
/** @override */
|
|
167
|
+
suspend(): StreamModule;
|
|
168
|
+
/**
|
|
169
|
+
* This method gets stream module parameters as associative array.
|
|
170
|
+
* @return {StreamModuleParams}
|
|
171
|
+
* @override
|
|
172
|
+
*/
|
|
173
|
+
params(): StreamModuleParams;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/StreamModule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAsB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