xsound 2.28.1 → 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 -28
- 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 +36 -30
- package/build/xsound.d.ts +0 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Token } from '../../src/MML/Token';
|
|
2
|
+
/**
|
|
3
|
+
* This class is entity for MML syntax tree.
|
|
4
|
+
* @constructor
|
|
5
|
+
*/
|
|
6
|
+
export declare class Tree {
|
|
7
|
+
private _id;
|
|
8
|
+
private _operator;
|
|
9
|
+
private _left;
|
|
10
|
+
private _right;
|
|
11
|
+
private indent;
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} id This argument is string that identifies syntax tree node.
|
|
14
|
+
* @param {Token} operator This argument is instance of `Token` as syntax tree node.
|
|
15
|
+
* @param {Tree} left This argument is instance of `Tree` as left partial tree.
|
|
16
|
+
* @param {Tree} right This argument is instance of `Tree` as right partial tree.
|
|
17
|
+
*/
|
|
18
|
+
constructor(id: string, operator: Token, left: Tree | null, right: Tree | null);
|
|
19
|
+
/**
|
|
20
|
+
* This method concatenates partial tree as right partial tree.
|
|
21
|
+
* @param {Tree} operator This argument is instance of `Tree` as syntax tree node.
|
|
22
|
+
*/
|
|
23
|
+
concat(node: Tree): void;
|
|
24
|
+
/**
|
|
25
|
+
* This method is getter for operator.
|
|
26
|
+
*/
|
|
27
|
+
get operator(): Token;
|
|
28
|
+
/**
|
|
29
|
+
* This method is getter for left partial tree
|
|
30
|
+
*/
|
|
31
|
+
get left(): Tree | null;
|
|
32
|
+
/**
|
|
33
|
+
* This method is getter for right partial tree
|
|
34
|
+
*/
|
|
35
|
+
get right(): Tree | null;
|
|
36
|
+
/**
|
|
37
|
+
* This method clears indent.
|
|
38
|
+
*/
|
|
39
|
+
clear(): void;
|
|
40
|
+
/**
|
|
41
|
+
* This method represents tree status as string.
|
|
42
|
+
*/
|
|
43
|
+
toString(): string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* This class is error class for MML syntax error (extends `Error`).
|
|
47
|
+
* @constructor
|
|
48
|
+
*/
|
|
49
|
+
export declare class MMLSyntaxError extends Error {
|
|
50
|
+
private _token;
|
|
51
|
+
/**
|
|
52
|
+
* @param {Token} token This argument is instance of `Token` that error occurs in.
|
|
53
|
+
*/
|
|
54
|
+
constructor(token: Token);
|
|
55
|
+
/**
|
|
56
|
+
* This method is getter for instance of `Token`.
|
|
57
|
+
*/
|
|
58
|
+
get token(): Token;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=Tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../src/MML/Tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;GAGG;AACH,qBAAa,IAAI;IACf,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,SAAS,CAAQ;IAGzB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,MAAM,CAAc;IAG5B,OAAO,CAAC,MAAM,CAAK;IAEnB;;;;;OAKG;gBACS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI;IAO9E;;;OAGG;IACI,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAI/B;;OAEG;IACH,IAAW,QAAQ,IAAI,KAAK,CAE3B;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,IAAI,GAAG,IAAI,CAE7B;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,IAAI,GAAG,IAAI,CAE9B;IAED;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;OAEG;IACI,QAAQ,IAAI,MAAM;CAiB1B;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,OAAO,CAAC,MAAM,CAAQ;IAEtB;;OAEG;gBACS,KAAK,EAAE,KAAK;IAMxB;;OAEG;IACH,IAAW,KAAK,IAAI,KAAK,CAExB;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Tokenizer } from './Tokenizer';
|
|
2
|
+
import { Tree, MMLSyntaxError } from './Tree';
|
|
3
|
+
/**
|
|
4
|
+
* This class is Tree Construction (syntax tree) for MML (Music Macro Language).
|
|
5
|
+
* @constructor
|
|
6
|
+
*/
|
|
7
|
+
export declare class TreeConstructor {
|
|
8
|
+
static id: number;
|
|
9
|
+
private tokenizer;
|
|
10
|
+
private syntaxTree;
|
|
11
|
+
/**
|
|
12
|
+
* @param {Tokenizer} tokenizer This argument is instance of `Tokenizer`.
|
|
13
|
+
*/
|
|
14
|
+
constructor(tokenizer: Tokenizer);
|
|
15
|
+
/**
|
|
16
|
+
* This method executes tree construction (parsing) from tokens.
|
|
17
|
+
* @return {Array<Tree>|MMLSyntaxError} Return value is syntax tree.
|
|
18
|
+
*/
|
|
19
|
+
parse(): Tree[] | MMLSyntaxError;
|
|
20
|
+
/**
|
|
21
|
+
* This method releases memory that stack has.
|
|
22
|
+
*/
|
|
23
|
+
free(): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=TreeConstructor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeConstructor.d.ts","sourceRoot":"","sources":["../../../src/MML/TreeConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE9C;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAc,EAAE,SAAK;IAErB,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,UAAU,CAAc;IAEhC;;OAEG;gBACS,SAAS,EAAE,SAAS;IAIhC;;;OAGG;IACI,KAAK,IAAI,IAAI,EAAE,GAAG,cAAc;IAuHvC;;OAEG;IACI,IAAI,IAAI,IAAI;CAGpB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { OscillatorModule } from '../OscillatorModule';
|
|
2
|
+
import { OneshotModule } from '../OneshotModule';
|
|
3
|
+
import { NoiseModule } from '../NoiseModule';
|
|
4
|
+
import { TokenType, TokenMap, Token } from './Token';
|
|
5
|
+
import { Tree, MMLSyntaxError } from './Tree';
|
|
6
|
+
import { Sequence } from './Sequence';
|
|
7
|
+
import { Part } from './Part';
|
|
8
|
+
export type { Part, Sequence, MMLSyntaxError, Tree, TokenType, TokenMap, Token };
|
|
9
|
+
/**
|
|
10
|
+
* This class manages instance of `Part` for playing MML (Music Macro Language).
|
|
11
|
+
* @constructor
|
|
12
|
+
*/
|
|
13
|
+
export declare class MML {
|
|
14
|
+
private parts;
|
|
15
|
+
private startCallback;
|
|
16
|
+
private stopCallback;
|
|
17
|
+
private endedCallback;
|
|
18
|
+
private errorCallback;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* @param {function} startCallback This argument is invoked
|
|
22
|
+
* @param {function} stopCallback
|
|
23
|
+
* @param {function} endedCallback
|
|
24
|
+
* @param {function} errorCallback
|
|
25
|
+
*/
|
|
26
|
+
setup(callbacks?: {
|
|
27
|
+
startCallback?(sequence: Sequence, offset?: number): void;
|
|
28
|
+
stopCallback?(sequence: Sequence, offset?: number): void;
|
|
29
|
+
endedCallback?(): void;
|
|
30
|
+
errorCallback?(error: MMLSyntaxError): void;
|
|
31
|
+
}): MML;
|
|
32
|
+
/**
|
|
33
|
+
* This method parses MML string.
|
|
34
|
+
* @param {OscillatorModule|OneshotModule|NoiseModule} source This argument selects sound source.
|
|
35
|
+
* @param {Array<string>} mmls This argument is MML strings.
|
|
36
|
+
* @param {number} offset This argument is in order to adjust index of one-shot audio.
|
|
37
|
+
* @return {MML} Return value is for method chain.
|
|
38
|
+
*/
|
|
39
|
+
ready(params: {
|
|
40
|
+
source: OscillatorModule | OneshotModule | NoiseModule;
|
|
41
|
+
mmls: string[];
|
|
42
|
+
offset?: number;
|
|
43
|
+
}): MML;
|
|
44
|
+
/**
|
|
45
|
+
* This method starts designated MML part. Moreover, this method schedules next sequence.
|
|
46
|
+
* @param {number} partNumber This argument is part of MML.
|
|
47
|
+
* @param {boolean} highlight This argument is `true` in case of surrounding by `span.x-highlight` HTML. The default value is `false`.
|
|
48
|
+
* @return {MML} Return value is for method chain.
|
|
49
|
+
*/
|
|
50
|
+
start(partNumber: number, highlight?: boolean): this;
|
|
51
|
+
/**
|
|
52
|
+
* This method stops the all of MML parts.
|
|
53
|
+
* @return {MML} Return value is for method chain.
|
|
54
|
+
*/
|
|
55
|
+
stop(): MML;
|
|
56
|
+
/**
|
|
57
|
+
* This method gets MML string.
|
|
58
|
+
* @param {number} index This argument selects MML part.
|
|
59
|
+
* @return {string|null}
|
|
60
|
+
*/
|
|
61
|
+
getMML(index: number): string | null;
|
|
62
|
+
/**
|
|
63
|
+
* This method gets array that contains MML string.
|
|
64
|
+
* @return {Array<string>}
|
|
65
|
+
*/
|
|
66
|
+
getMMLs(): string[];
|
|
67
|
+
/**
|
|
68
|
+
* This method determines whether sequences exist.
|
|
69
|
+
* @return {boolean} If sequences exist, this value is `true`. Otherwise, this value is `false`.
|
|
70
|
+
*/
|
|
71
|
+
has(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* This method gets array that contains instance of `Sequence`.
|
|
74
|
+
* @param {number} index This argument selects MML part.
|
|
75
|
+
* @return {Array<Sequence>}
|
|
76
|
+
*/
|
|
77
|
+
getSequences(index: number): Sequence[] | null;
|
|
78
|
+
/**
|
|
79
|
+
* This method gets array that contains instance of `Sequence` from the all of MML parts.
|
|
80
|
+
* @return {Array<Array<Sequence>>}
|
|
81
|
+
*/
|
|
82
|
+
getAllSequences(): Sequence[][];
|
|
83
|
+
/**
|
|
84
|
+
* This method determines whether MMLs are paused.
|
|
85
|
+
* @return {boolean} If MMLs are paused, this value is `true`. Otherwise, this value is `false`.
|
|
86
|
+
*/
|
|
87
|
+
paused(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* This method gets or sets current sequence index.
|
|
90
|
+
* This method is overloaded for type interface and type check.
|
|
91
|
+
* @param {number} partNumber This argument is part of MML.
|
|
92
|
+
* @param {number} sequenceIndex This argument is sequence index.
|
|
93
|
+
* If this argument is omitted, this method is getter for current sequence index.
|
|
94
|
+
* @return {number|MML} Return value is for current sequence index. Otherwise, Return value is for method chain.
|
|
95
|
+
*/
|
|
96
|
+
currentIndex(partNumber: number): number;
|
|
97
|
+
currentIndex(partNumber: number, sequenceIndex: number): MML;
|
|
98
|
+
/**
|
|
99
|
+
* This method clears instance of `Part`.
|
|
100
|
+
* @return {MML} Return value is for method chain.
|
|
101
|
+
*/
|
|
102
|
+
clear(): MML;
|
|
103
|
+
/**
|
|
104
|
+
* This method converts MML to ABC Notation.
|
|
105
|
+
* @param {string} mml This argument is MML string.
|
|
106
|
+
* @param {number} X This argument is file number in ABC Notation.
|
|
107
|
+
* @param {string} T This argument is title in ABC Notation.
|
|
108
|
+
* @param {string} M This argument is beat in ABC Notation.
|
|
109
|
+
* @param {string} L This argument is note duration in ABC Notation.
|
|
110
|
+
* @param {string} K This argument is tone in ABC Notation.
|
|
111
|
+
* @return {string} This is returned as ABC Notation.
|
|
112
|
+
*/
|
|
113
|
+
toABC(mml: string, X?: number, T?: string, M?: string, L?: string, K?: string): string;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MML/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACN,CAAC;AAEF;;;GAGG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,KAAK,CAAc;IAE3B,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,aAAa;;IAMrB;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CAAC,EAAE;QACvB,aAAa,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1D,YAAY,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC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|
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 { VocalCanceler, VocalCancelerParams } from '../SoundModule/Effectors/VocalCanceler';
|
|
25
|
+
export declare type MediaModuleParams = SoundModuleParams & {
|
|
26
|
+
vocalcanceler: VocalCancelerParams;
|
|
27
|
+
autoplay?: boolean;
|
|
28
|
+
playbackRate?: number;
|
|
29
|
+
currentTime?: number;
|
|
30
|
+
controls?: boolean;
|
|
31
|
+
loop?: boolean;
|
|
32
|
+
muted?: boolean;
|
|
33
|
+
readonly duration?: number;
|
|
34
|
+
};
|
|
35
|
+
declare type Params = Partial<Pick<MediaModuleParams, 'mastervolume' | 'autoplay' | 'playbackRate' | 'currentTime' | 'controls' | 'loop' | 'muted' | 'duration'>>;
|
|
36
|
+
/**
|
|
37
|
+
* This class processes sound data from `HTMLMediaElement`.
|
|
38
|
+
* Namely, this class enables to create audio player that has higher features from `HTMLMediaElement`.
|
|
39
|
+
* But, this class is disadvantage to play many one shot audios.
|
|
40
|
+
* In that case, developer should use `OneshotModule`.
|
|
41
|
+
* @constructor
|
|
42
|
+
* @extends {SoundModule}
|
|
43
|
+
*/
|
|
44
|
+
export declare class MediaModule extends SoundModule {
|
|
45
|
+
private source;
|
|
46
|
+
private media;
|
|
47
|
+
private vocalcanceler;
|
|
48
|
+
private ext;
|
|
49
|
+
private autoplay;
|
|
50
|
+
private mediaSource;
|
|
51
|
+
private sourceBuffer;
|
|
52
|
+
private file;
|
|
53
|
+
private mimeType;
|
|
54
|
+
private listeners;
|
|
55
|
+
/**
|
|
56
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
57
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
58
|
+
*/
|
|
59
|
+
constructor(context: AudioContext, bufferSize: BufferSize);
|
|
60
|
+
/**
|
|
61
|
+
* This method gets `HTMLMediaElement` and selects media format. In addition, this method adds event listeners that are defined by `HTMLMediaElement`.
|
|
62
|
+
* @param {HTMLAudioElement|HTMLVideoElement} media This argument is either `HTMLAudioElement` or `HTMLVideoElement`.
|
|
63
|
+
* @param {Array<string>} formats This argument is usable media format. For example, 'wav', 'ogg', 'webm', 'mp4' ...etc.
|
|
64
|
+
* @param {boolean} autoplay This argument is in order to determine autoplay. The default value is `false`.
|
|
65
|
+
* @param {{ [eventType: string]: (event: Event | Error) => void }} listeners This argument is event listeners that are defined by `HTMLMediaElement`.
|
|
66
|
+
* @return {MediaModule} Return value is for method chain.
|
|
67
|
+
*/
|
|
68
|
+
setup(params: {
|
|
69
|
+
media: HTMLAudioElement | HTMLVideoElement;
|
|
70
|
+
formats?: string[];
|
|
71
|
+
autoplay?: boolean;
|
|
72
|
+
listeners?: {
|
|
73
|
+
[eventType: string]: (event: Event | Error) => void;
|
|
74
|
+
};
|
|
75
|
+
}): MediaModule;
|
|
76
|
+
/**
|
|
77
|
+
* This method prepares for playing media anytime after loading media resource.
|
|
78
|
+
* @param {string} source This argument is path name or `Data URL` or `Object URL` for media resource.
|
|
79
|
+
* @param {string} mimeType This argument is required in case of audio streaming.
|
|
80
|
+
* @return {MediaModule} Return value is for method chain.
|
|
81
|
+
*/
|
|
82
|
+
ready(src: string, mimeType?: string): MediaModule;
|
|
83
|
+
/**
|
|
84
|
+
* This method starts media from designated time.
|
|
85
|
+
* @param {number} position This argument is time that media is started at. The default value is `0`.
|
|
86
|
+
* @return {MediaModule} Return value is for method chain.
|
|
87
|
+
*/
|
|
88
|
+
start(position?: number): MediaModule;
|
|
89
|
+
/**
|
|
90
|
+
* This method stops media.
|
|
91
|
+
* @param {function} successCallback This argument is invoked on success
|
|
92
|
+
* @param {function} errorCallback This argument is invoked on failure
|
|
93
|
+
* @return {MediaModule} Return value is for method chain.
|
|
94
|
+
*/
|
|
95
|
+
stop(successCallback?: () => void, errorCallback?: (error: Error) => void): MediaModule;
|
|
96
|
+
/**
|
|
97
|
+
* This method gets or sets parameters for media module.
|
|
98
|
+
* This method is overloaded for type interface and type check.
|
|
99
|
+
* @param {keyof Params|Params} params This argument is string if getter. Otherwise, setter.
|
|
100
|
+
* @return {Params[keyof Params]|MediaModule} Return value is parameter for media module if getter.
|
|
101
|
+
* Otherwise, return value is for method chain.
|
|
102
|
+
*/
|
|
103
|
+
param(params: 'mastervolume'): number;
|
|
104
|
+
param(params: 'autoplay'): boolean;
|
|
105
|
+
param(params: 'playbackRate'): number;
|
|
106
|
+
param(params: 'currentTime'): number;
|
|
107
|
+
param(params: 'controls'): boolean;
|
|
108
|
+
param(params: 'loop'): boolean;
|
|
109
|
+
param(params: 'muted'): boolean;
|
|
110
|
+
param(params: 'duration'): boolean;
|
|
111
|
+
param(params: 'duration'): boolean;
|
|
112
|
+
param(params: Params): MediaModule;
|
|
113
|
+
/**
|
|
114
|
+
* This method gets instance of `MediaElementAudioSourceNode`.
|
|
115
|
+
* @return {MediaElementAudioSourceNode|null}
|
|
116
|
+
*/
|
|
117
|
+
get(): MediaElementAudioSourceNode | null;
|
|
118
|
+
/**
|
|
119
|
+
* This method determines whether instance of `HTMLMediaElement` exists.
|
|
120
|
+
* @return {boolean} If instance of `HTMLMediaElement` already exists, this value is `true`. Otherwise, this value is `false`.
|
|
121
|
+
*/
|
|
122
|
+
hasMedia(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* This method determines whether instance of `MediaElementAudioSourceNode` exists.
|
|
125
|
+
* @return {boolean} If instance of `MediaElementAudioSourceNode` already exists, this value is `true`. Otherwise, this value is `false`.
|
|
126
|
+
*/
|
|
127
|
+
hasSource(): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* This method determines whether media is paused.
|
|
130
|
+
* @return {boolean} If media is paused, this value is `true`. Otherwise, this value is `false`.
|
|
131
|
+
*/
|
|
132
|
+
paused(): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* This method gets or sets fade-in time.
|
|
135
|
+
* @param {number} time This argument is fade-in time. If this argument is omitted, this method is getter.
|
|
136
|
+
* @return {number|MediaModule} Return value is fade-in time. Otherwise, return value is for method chain.
|
|
137
|
+
*/
|
|
138
|
+
fadeIn(time?: number): number | MediaModule;
|
|
139
|
+
/**
|
|
140
|
+
* This method gets or sets fade-out time.
|
|
141
|
+
* @param {number} time This argument is fade-out time. If this argument is omitted, this method is getter.
|
|
142
|
+
* @return {number|MediaModule} Return value is fade-out time. Otherwise, return value is for method chain.
|
|
143
|
+
*/
|
|
144
|
+
fadeOut(time?: number): number | MediaModule;
|
|
145
|
+
/**
|
|
146
|
+
* This method requests Picture In Picture (PIP).
|
|
147
|
+
* @return {Promise<PictureInPictureWindow>} Return value is `Promise`.
|
|
148
|
+
*/
|
|
149
|
+
requestPictureInPicture(): Promise<PictureInPictureWindow>;
|
|
150
|
+
/**
|
|
151
|
+
* This method exits from Picture In Picture (PIP).
|
|
152
|
+
* @return {Promise<void>} Return value is `Promise`.
|
|
153
|
+
*/
|
|
154
|
+
exitPictureInPicture(): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* This method gets instance of `Module` (Analyser, Recorder, Effector ... etc).
|
|
157
|
+
* @param {ModuleName|'vocalcanceler'} moduleName This argument selects module.
|
|
158
|
+
* @return {Module|VocalCanceler}
|
|
159
|
+
*/
|
|
160
|
+
module(moduleName: 'analyser'): Analyser;
|
|
161
|
+
module(moduleName: 'recorder'): Recorder;
|
|
162
|
+
module(moduleName: 'session'): Session;
|
|
163
|
+
module(moduleName: 'autopanner'): Autopanner;
|
|
164
|
+
module(moduleName: 'chorus'): Chorus;
|
|
165
|
+
module(moduleName: 'compressor'): Compressor;
|
|
166
|
+
module(moduleName: 'delay'): Delay;
|
|
167
|
+
module(moduleName: 'distortion'): Distortion;
|
|
168
|
+
module(moduleName: 'equalizer'): Equalizer;
|
|
169
|
+
module(moduleName: 'filter'): Filter;
|
|
170
|
+
module(moduleName: 'flanger'): Flanger;
|
|
171
|
+
module(moduleName: 'listener'): Listener;
|
|
172
|
+
module(moduleName: 'panner'): Panner;
|
|
173
|
+
module(moduleName: 'phaser'): Phaser;
|
|
174
|
+
module(moduleName: 'pitchshifter'): PitchShifter;
|
|
175
|
+
module(moduleName: 'reverb'): Reverb;
|
|
176
|
+
module(moduleName: 'ringmodulator'): Ringmodulator;
|
|
177
|
+
module(moduleName: 'stereo'): Stereo;
|
|
178
|
+
module(moduleName: 'tremolo'): Tremolo;
|
|
179
|
+
module(moduleName: 'wah'): Wah;
|
|
180
|
+
module(moduleName: 'envelopegenerator'): EnvelopeGenerator;
|
|
181
|
+
module(moduleName: 'vocalcanceler'): VocalCanceler;
|
|
182
|
+
/** @override */
|
|
183
|
+
resize(bufferSize: BufferSize): MediaModule;
|
|
184
|
+
/** @override */
|
|
185
|
+
on(startTime?: number): MediaModule;
|
|
186
|
+
/** @override */
|
|
187
|
+
off(stopTime?: number): MediaModule;
|
|
188
|
+
/** @override */
|
|
189
|
+
suspend(): MediaModule;
|
|
190
|
+
/**
|
|
191
|
+
* This method gets media module parameters as associative array.
|
|
192
|
+
* @return {MediaModuleParams}
|
|
193
|
+
* @override
|
|
194
|
+
*/
|
|
195
|
+
params(): MediaModuleParams;
|
|
196
|
+
/**
|
|
197
|
+
* This method is event listener for `MediaSource`
|
|
198
|
+
* @param {Event} event This argument is instance of `Event`.
|
|
199
|
+
*/
|
|
200
|
+
private onSourceOpen;
|
|
201
|
+
/**
|
|
202
|
+
* This method is event listener for `MediaSource`
|
|
203
|
+
* @param {Event} event This argument is instance of `Event`.
|
|
204
|
+
*/
|
|
205
|
+
private onSourceEnded;
|
|
206
|
+
/**
|
|
207
|
+
* This method is event listener for `MediaSource`
|
|
208
|
+
* @param {Event} event This argument is instance of `Event`.
|
|
209
|
+
*/
|
|
210
|
+
private onSourceClose;
|
|
211
|
+
/**
|
|
212
|
+
* This method is event listener for `SourceBuffer`
|
|
213
|
+
* @param {Event} event This argument is instance of `Event`.
|
|
214
|
+
*/
|
|
215
|
+
private onSourceBufferUpdateEnd;
|
|
216
|
+
/**
|
|
217
|
+
* This method is event listener for `SourceBuffer`
|
|
218
|
+
* @param {Event} event This argument is instance of `Event`.
|
|
219
|
+
*/
|
|
220
|
+
private onSourceBufferError;
|
|
221
|
+
}
|
|
222
|
+
export {};
|
|
223
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MediaModule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAO,UAAU,CAAC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AAgB;IACA,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW;IAKnD,gBAAgB;IACA,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAKnD,gBAAgB;IACA,OAAO,IAAI,WAAW;IAKtC;;;;OAIG;IACa,MAAM,IAAI,iBAAiB;IAgB3C;;;OAGG;IAEH,OAAO,CAAC,YAAY;IA8BpB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAMrB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAMrB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAM/B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAK5B"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { BufferSize } from '../types';
|
|
2
|
+
import { SoundModule } 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
|
+
/**
|
|
25
|
+
* This class is for mixing sound sources (instance of `SoundModule` subclass).
|
|
26
|
+
* @constructor
|
|
27
|
+
* @extends {SoundModule}
|
|
28
|
+
*/
|
|
29
|
+
export declare class MixerModule extends SoundModule {
|
|
30
|
+
private sources;
|
|
31
|
+
private runningAnalyser;
|
|
32
|
+
/**
|
|
33
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
34
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
35
|
+
*/
|
|
36
|
+
constructor(context: AudioContext, bufferSize: BufferSize);
|
|
37
|
+
/**
|
|
38
|
+
* This method defines noop for the same API.
|
|
39
|
+
*/
|
|
40
|
+
setup(): MixerModule;
|
|
41
|
+
/**
|
|
42
|
+
* This method defines noop for the same API.
|
|
43
|
+
*/
|
|
44
|
+
ready(): MixerModule;
|
|
45
|
+
/**
|
|
46
|
+
* This method is alias to `mix` method.
|
|
47
|
+
*/
|
|
48
|
+
start(sources: SoundModule[]): MixerModule;
|
|
49
|
+
/**
|
|
50
|
+
* This method defines noop for the same API.
|
|
51
|
+
*/
|
|
52
|
+
stop(): MixerModule;
|
|
53
|
+
/**
|
|
54
|
+
* This method mixes sound sources (instance of `SoundModule` subclass).
|
|
55
|
+
* @param {Array<SoundModule>} sources This argument is array that contains sound sources.
|
|
56
|
+
* @return {MixerModule} Return value is for method chain.
|
|
57
|
+
*/
|
|
58
|
+
mix(sources: SoundModule[]): MixerModule;
|
|
59
|
+
/**
|
|
60
|
+
* This method gets array that contains instance of `SoundModule` subclass.
|
|
61
|
+
* @return {Array<SoundModule>}
|
|
62
|
+
*/
|
|
63
|
+
get(): SoundModule[];
|
|
64
|
+
/**
|
|
65
|
+
* This method gets instance of `Module` (Analyser, Recorder, Effector ... etc).
|
|
66
|
+
* @param {ModuleName} moduleName This argument selects module.
|
|
67
|
+
* @return {Module}
|
|
68
|
+
*/
|
|
69
|
+
module(moduleName: 'analyser'): Analyser;
|
|
70
|
+
module(moduleName: 'recorder'): Recorder;
|
|
71
|
+
module(moduleName: 'session'): Session;
|
|
72
|
+
module(moduleName: 'autopanner'): Autopanner;
|
|
73
|
+
module(moduleName: 'chorus'): Chorus;
|
|
74
|
+
module(moduleName: 'compressor'): Compressor;
|
|
75
|
+
module(moduleName: 'delay'): Delay;
|
|
76
|
+
module(moduleName: 'distortion'): Distortion;
|
|
77
|
+
module(moduleName: 'equalizer'): Equalizer;
|
|
78
|
+
module(moduleName: 'filter'): Filter;
|
|
79
|
+
module(moduleName: 'flanger'): Flanger;
|
|
80
|
+
module(moduleName: 'listener'): Listener;
|
|
81
|
+
module(moduleName: 'panner'): Panner;
|
|
82
|
+
module(moduleName: 'phaser'): Phaser;
|
|
83
|
+
module(moduleName: 'pitchshifter'): PitchShifter;
|
|
84
|
+
module(moduleName: 'reverb'): Reverb;
|
|
85
|
+
module(moduleName: 'ringmodulator'): Ringmodulator;
|
|
86
|
+
module(moduleName: 'stereo'): Stereo;
|
|
87
|
+
module(moduleName: 'tremolo'): Tremolo;
|
|
88
|
+
module(moduleName: 'wah'): Wah;
|
|
89
|
+
module(moduleName: 'envelopegenerator'): EnvelopeGenerator;
|
|
90
|
+
/** @override */
|
|
91
|
+
resize(bufferSize: BufferSize): MixerModule;
|
|
92
|
+
/** @override */
|
|
93
|
+
on(startTime?: number): MixerModule;
|
|
94
|
+
/** @override */
|
|
95
|
+
off(stopTime?: number): MixerModule;
|
|
96
|
+
/** @override */
|
|
97
|
+
suspend(): MixerModule;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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IAChD,MAAM,CAAC,UAAU,EAAE,QAAQ,GAAG,MAAM;IACpC,MAAM,CAAC,UAAU,EAAE,eAAe,GAAG,aAAa;IAClD,MAAM,CAAC,UAAU,EAAE,QAAQ,GAAG,MAAM;IACpC,MAAM,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO;IACtC,MAAM,CAAC,UAAU,EAAE,KAAK,GAAG,GAAG;IAC9B,MAAM,CAAC,UAAU,EAAE,mBAAmB,GAAG,iBAAiB;IAkDjE,gBAAgB;IACA,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW;IAK3D,gBAAgB;IACA,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW;IAKnD,gBAAgB;IACA,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW;IAKnD,gBAAgB;IACA,OAAO,IAAI,WAAW;CAIvC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
export declare type NoiseType = 'whitenoise' | 'pinknoise' | 'browniannoise';
|
|
25
|
+
export declare type NoiseModuleParams = SoundModuleParams & {
|
|
26
|
+
type: NoiseType;
|
|
27
|
+
};
|
|
28
|
+
declare type Params = Partial<Pick<NoiseModuleParams, 'mastervolume' | 'type'>>;
|
|
29
|
+
export declare class NoiseModule extends SoundModule {
|
|
30
|
+
private type;
|
|
31
|
+
private runningAnalyser;
|
|
32
|
+
/**
|
|
33
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
34
|
+
* @param {BufferSize} bufferSize This argument is buffer size for `ScriptProcessorNode`.
|
|
35
|
+
*/
|
|
36
|
+
constructor(context: AudioContext, bufferSize: BufferSize);
|
|
37
|
+
/**
|
|
38
|
+
* This method defines noop for the same API.
|
|
39
|
+
*/
|
|
40
|
+
setup(): NoiseModule;
|
|
41
|
+
/**
|
|
42
|
+
* This method defines noop for the same API.
|
|
43
|
+
*/
|
|
44
|
+
ready(): NoiseModule;
|
|
45
|
+
/**
|
|
46
|
+
* This method starts noise.
|
|
47
|
+
* @return {NoiseModule} Return value is for method chain.
|
|
48
|
+
*/
|
|
49
|
+
start(): NoiseModule;
|
|
50
|
+
/**
|
|
51
|
+
* This method stops noise.
|
|
52
|
+
* @return {NoiseModule} Return value is for method chain.
|
|
53
|
+
*/
|
|
54
|
+
stop(): NoiseModule;
|
|
55
|
+
/**
|
|
56
|
+
* This method gets or sets parameters for noise module.
|
|
57
|
+
* @param {keyof Params|Params} params This argument is string if getter. Otherwise, setter.
|
|
58
|
+
* @return {Params[keyof Params]|NoiseModule} Return value is parameter for noise module if getter.
|
|
59
|
+
* Otherwise, return value is for method chain.
|
|
60
|
+
*/
|
|
61
|
+
param(params: 'mastervolume'): number;
|
|
62
|
+
param(params: 'type'): NoiseType;
|
|
63
|
+
param(params: Params): NoiseModule;
|
|
64
|
+
/**
|
|
65
|
+
* This method gets instance of `Module` (Analyser, Recorder, Effector ... etc).
|
|
66
|
+
* @param {ModuleName} moduleName This argument selects module.
|
|
67
|
+
* @return {Module}
|
|
68
|
+
*/
|
|
69
|
+
module(moduleName: 'analyser'): Analyser;
|
|
70
|
+
module(moduleName: 'recorder'): Recorder;
|
|
71
|
+
module(moduleName: 'session'): Session;
|
|
72
|
+
module(moduleName: 'autopanner'): Autopanner;
|
|
73
|
+
module(moduleName: 'chorus'): Chorus;
|
|
74
|
+
module(moduleName: 'compressor'): Compressor;
|
|
75
|
+
module(moduleName: 'delay'): Delay;
|
|
76
|
+
module(moduleName: 'distortion'): Distortion;
|
|
77
|
+
module(moduleName: 'equalizer'): Equalizer;
|
|
78
|
+
module(moduleName: 'filter'): Filter;
|
|
79
|
+
module(moduleName: 'flanger'): Flanger;
|
|
80
|
+
module(moduleName: 'listener'): Listener;
|
|
81
|
+
module(moduleName: 'panner'): Panner;
|
|
82
|
+
module(moduleName: 'phaser'): Phaser;
|
|
83
|
+
module(moduleName: 'pitchshifter'): PitchShifter;
|
|
84
|
+
module(moduleName: 'reverb'): Reverb;
|
|
85
|
+
module(moduleName: 'ringmodulator'): Ringmodulator;
|
|
86
|
+
module(moduleName: 'stereo'): Stereo;
|
|
87
|
+
module(moduleName: 'tremolo'): Tremolo;
|
|
88
|
+
module(moduleName: 'wah'): Wah;
|
|
89
|
+
module(moduleName: 'envelopegenerator'): EnvelopeGenerator;
|
|
90
|
+
/** @override */
|
|
91
|
+
resize(bufferSize: BufferSize): NoiseModule;
|
|
92
|
+
/** @override */
|
|
93
|
+
on(startTime?: number): NoiseModule;
|
|
94
|
+
/** @override */
|
|
95
|
+
off(stopTime?: number): NoiseModule;
|
|
96
|
+
/** @override */
|
|
97
|
+
suspend(): NoiseModule;
|
|
98
|
+
/**
|
|
99
|
+
* This method gets noise module parameters as associative array.
|
|
100
|
+
* @return {NoiseModuleParams}
|
|
101
|
+
* @override
|
|
102
|
+
*/
|
|
103
|
+
params(): NoiseModuleParams;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=index.d.ts.map
|