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,61 @@
|
|
|
1
|
+
import { Channel, DataType } from '../Analyser';
|
|
2
|
+
import { Visualizer, VisualizerParams, GraphicsStyles } from './Visualizer';
|
|
3
|
+
export declare type FFTParams = VisualizerParams & {
|
|
4
|
+
type?: DataType;
|
|
5
|
+
size?: number;
|
|
6
|
+
textInterval?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* This private class visualizes spectrum.
|
|
10
|
+
* @constructor
|
|
11
|
+
* @extends {Visualizer}
|
|
12
|
+
*/
|
|
13
|
+
export declare class FFT extends Visualizer {
|
|
14
|
+
private type;
|
|
15
|
+
private size;
|
|
16
|
+
private textInterval;
|
|
17
|
+
/**
|
|
18
|
+
* @param {number} sampleRate This argument is sample rate.
|
|
19
|
+
* @param {Channel} channel This argument is channel number (Left: 0, Right: 1 ...).
|
|
20
|
+
*/
|
|
21
|
+
constructor(sampleRate: number, channel: Channel);
|
|
22
|
+
/** @override */
|
|
23
|
+
setup(element: HTMLCanvasElement | SVGSVGElement): FFT;
|
|
24
|
+
/**
|
|
25
|
+
* This method gets or sets parameters for visualizing spectrum.
|
|
26
|
+
* This method is overloaded for type interface and type check.
|
|
27
|
+
* @param {keyof FFTParams|FFTParams} params This argument is string if getter. Otherwise, setter.
|
|
28
|
+
* @return {FFTParams[keyof FFTParams]|FFT} Return value is parameter for visualizing spectrum if getter.
|
|
29
|
+
* Otherwise, return value is for method chain.
|
|
30
|
+
* @override
|
|
31
|
+
*/
|
|
32
|
+
param(params: 'interval'): number;
|
|
33
|
+
param(params: 'styles'): GraphicsStyles;
|
|
34
|
+
param(params: 'type'): DataType;
|
|
35
|
+
param(params: 'size'): number;
|
|
36
|
+
param(params: 'textInterval'): number;
|
|
37
|
+
param(params: FFTParams): FFT;
|
|
38
|
+
/** @override */
|
|
39
|
+
clear(): FFT;
|
|
40
|
+
/** @override */
|
|
41
|
+
activate(): FFT;
|
|
42
|
+
/** @override */
|
|
43
|
+
deactivate(): FFT;
|
|
44
|
+
/**
|
|
45
|
+
* This method visualizes spectrum to Canvas.
|
|
46
|
+
* @param {Uint8Array|Float32Array} data This argument is frequency domain data for spectrum.
|
|
47
|
+
* @param {number} minDecibels This argument is in order to determine dB range of spectrum. The default value is -100 dB.
|
|
48
|
+
* @param {number} maxDecibels This argument is in order to determine db range of spectrum. The default value is -30 dB.
|
|
49
|
+
* @override
|
|
50
|
+
*/
|
|
51
|
+
protected visualizeOnCanvas(data: Uint8Array | Float32Array, minDecibels?: number, maxDecibels?: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* This method visualizes spectrum to SVG.
|
|
54
|
+
* @param {Uint8Array|Float32Array} data This argument is frequency domain data for spectrum.
|
|
55
|
+
* @param {number} minDecibels This argument is in order to determine dB range of spectrum. Default value is -100 dB.
|
|
56
|
+
* @param {number} maxDecibels This argument is in order to determine db range of spectrum. Default value is -30 dB.
|
|
57
|
+
* @override
|
|
58
|
+
*/
|
|
59
|
+
protected visualizeBySVG(data: Uint8Array | Float32Array, minDecibels?: number, maxDecibels?: number): void;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=FFT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FFT.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Analyser/FFT.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE5E,oBAAY,SAAS,GAAG,gBAAgB,GAAG;IACzC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,GAAI,SAAQ,UAAU;IACjC,OAAO,CAAC,IAAI,CAAoB;IAGhC,OAAO,CAAC,IAAI,CAAO;IAGnB,OAAO,CAAC,YAAY,CAAQ;IAE5B;;;OAGG;gBAES,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAIhD,gBAAgB;IACA,KAAK,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,GAAG,GAAG;IAKtE;;;;;;;OAOG;IACa,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IACjC,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,cAAc;IACvC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAC/B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAC7B,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM;IACrC,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,GAAG;IAoD7C,gBAAgB;IACA,KAAK,IAAI,GAAG;IAK5B,gBAAgB;IACA,QAAQ,IAAI,GAAG;IAK/B,gBAAgB;IACA,UAAU,IAAI,GAAG;IAKjC;;;;;;OAMG;cACgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAuMvH;;;;;;OAMG;cACgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;CAqSrH"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Channel, DataType } from '../Analyser';
|
|
2
|
+
import { Visualizer, VisualizerParams, GraphicsStyles } from './Visualizer';
|
|
3
|
+
export declare type TimeParams = VisualizerParams & {
|
|
4
|
+
type?: DataType;
|
|
5
|
+
textInterval?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* This private class visualizes sound wave in time domain.
|
|
9
|
+
* @constructor
|
|
10
|
+
* @extends {Visualizer}
|
|
11
|
+
*/
|
|
12
|
+
export declare class Time extends Visualizer {
|
|
13
|
+
private type;
|
|
14
|
+
private textInterval;
|
|
15
|
+
/**
|
|
16
|
+
* @param {number} sampleRate This argument is sample rate.
|
|
17
|
+
* @param {Channel} channel This argument is channel number (Left: 0, Right: 1 ...).
|
|
18
|
+
*/
|
|
19
|
+
constructor(sampleRate: number, channel: Channel);
|
|
20
|
+
/** @override */
|
|
21
|
+
setup(element: HTMLCanvasElement | SVGSVGElement): Time;
|
|
22
|
+
/**
|
|
23
|
+
* This method gets or sets parameters for visualizing sound wave.
|
|
24
|
+
* This method is overloaded for type interface and type check.
|
|
25
|
+
* @param {keyof TimeParams|TimeParams} params This argument is string if getter. Otherwise, setter.
|
|
26
|
+
* @return {TimeParams[keyof TimeParams]|Time} Return value is parameter for visualizing sound wave if getter.
|
|
27
|
+
* Otherwise, return value is for method chain.
|
|
28
|
+
* @override
|
|
29
|
+
*/
|
|
30
|
+
param(params: 'interval'): number;
|
|
31
|
+
param(params: 'styles'): GraphicsStyles;
|
|
32
|
+
param(params: 'type'): DataType;
|
|
33
|
+
param(params: 'textInterval'): number;
|
|
34
|
+
param(params: TimeParams): Time;
|
|
35
|
+
/** @override */
|
|
36
|
+
clear(): Time;
|
|
37
|
+
/** @override */
|
|
38
|
+
activate(): Time;
|
|
39
|
+
/** @override */
|
|
40
|
+
deactivate(): Time;
|
|
41
|
+
/**
|
|
42
|
+
* This method visualizes sound wave in time domain to Canvas.
|
|
43
|
+
* @param {Uint8Array|Float32Array} data This argument is sound data for visualization.
|
|
44
|
+
* @override
|
|
45
|
+
*/
|
|
46
|
+
protected visualizeOnCanvas(data: Uint8Array | Float32Array, _minDecibels?: number, _maxDecibels?: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* This method visualizes sound wave in time domain to SVG.
|
|
49
|
+
* @param {Uint8Array|Float32Array} data This argument is sound data for visualization.
|
|
50
|
+
* @override
|
|
51
|
+
*/
|
|
52
|
+
protected visualizeBySVG(data: Uint8Array | Float32Array, _minDecibels?: number, _maxDecibels?: number): void;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=Time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Analyser/Time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE5E,oBAAY,UAAU,GAAG,gBAAgB,GAAG;IAC1C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,OAAO,CAAC,IAAI,CAAoB;IAGhC,OAAO,CAAC,YAAY,CAAS;IAE7B;;;OAGG;gBAES,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAIhD,gBAAgB;IACA,KAAK,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,GAAG,IAAI;IAKvE;;;;;;;OAOG;IACa,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IACjC,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,cAAc;IACvC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAC/B,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM;IACrC,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IA4C/C,gBAAgB;IACA,KAAK,IAAI,IAAI;IAK7B,gBAAgB;IACA,QAAQ,IAAI,IAAI;IAKhC,gBAAgB;IACA,UAAU,IAAI,IAAI;IAKlC;;;;OAIG;cAEgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;IA6IzH;;;;OAIG;cAEgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;CAiNvH"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Channel } from '../Analyser';
|
|
2
|
+
import { Visualizer, VisualizerParams, Color, GraphicsStyles } from './Visualizer';
|
|
3
|
+
export declare type DragMode = 'update' | 'sprite';
|
|
4
|
+
export declare type DragCallbackFunction = (event: MouseEvent | TouchEvent, startTime: number, endTime: number, mode: DragMode, direction: boolean) => void;
|
|
5
|
+
export declare type CurrentTimeStyles = {
|
|
6
|
+
width?: number;
|
|
7
|
+
color?: Color;
|
|
8
|
+
};
|
|
9
|
+
export declare type TimeOverviewParams = VisualizerParams & {
|
|
10
|
+
currentTime?: CurrentTimeStyles;
|
|
11
|
+
sprite?: Color;
|
|
12
|
+
plotInterval?: number;
|
|
13
|
+
textInterval?: number;
|
|
14
|
+
mode?: DragMode;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* This private class visualizes audio wave overview in time domain.
|
|
18
|
+
* @constructor
|
|
19
|
+
* @extends {Visualizer}
|
|
20
|
+
*/
|
|
21
|
+
export declare class TimeOverview extends Visualizer {
|
|
22
|
+
private callback;
|
|
23
|
+
private currentImageData;
|
|
24
|
+
private currentSVGElement;
|
|
25
|
+
private currentDataSize;
|
|
26
|
+
private currentTime;
|
|
27
|
+
private sprite;
|
|
28
|
+
private plotInterval;
|
|
29
|
+
private textInterval;
|
|
30
|
+
private isDown;
|
|
31
|
+
private mode;
|
|
32
|
+
private offsetX;
|
|
33
|
+
private startTime;
|
|
34
|
+
private endTime;
|
|
35
|
+
/**
|
|
36
|
+
* @param {number} sampleRate This argument is sample rate.
|
|
37
|
+
* @param {Channel} channel This argument is channel number (Left: 0, Right: 1 ...).
|
|
38
|
+
*/
|
|
39
|
+
constructor(sampleRate: number, channel: Channel);
|
|
40
|
+
/** @override */
|
|
41
|
+
setup(element: HTMLCanvasElement | SVGSVGElement): TimeOverview;
|
|
42
|
+
/**
|
|
43
|
+
* This method gets or sets parameters for visualizing audio wave.
|
|
44
|
+
* This method is overloaded for type interface and type check.
|
|
45
|
+
* @param {keyof TimeOverviewParams|TimeOverviewParams} params This argument is string if getter. Otherwise, setter.
|
|
46
|
+
* @return {TimeOverviewParams[keyof TimeOverviewParams]|TimeOverview} Return value is parameter for visualizing audio wave if getter.
|
|
47
|
+
* Otherwise, return value is for method chain.
|
|
48
|
+
* @override
|
|
49
|
+
*/
|
|
50
|
+
param(params: 'interval'): number;
|
|
51
|
+
param(params: 'styles'): GraphicsStyles;
|
|
52
|
+
param(params: 'currentTime'): CurrentTimeStyles;
|
|
53
|
+
param(params: 'sprite'): Color;
|
|
54
|
+
param(params: 'plotInterval'): number;
|
|
55
|
+
param(params: 'textInterval'): number;
|
|
56
|
+
param(params: 'mode'): DragMode;
|
|
57
|
+
param(params: TimeOverviewParams): TimeOverview;
|
|
58
|
+
/**
|
|
59
|
+
* This method visualizes audio current time on Canvas or SVG.
|
|
60
|
+
* @param {number} time This argument is audio current time.
|
|
61
|
+
* @return {TimeOverview} Return value is for method chain.
|
|
62
|
+
*/
|
|
63
|
+
update(time: number): TimeOverview;
|
|
64
|
+
/**
|
|
65
|
+
* This method registers event listener for updating current time or spriting audio by drag.
|
|
66
|
+
* @param {DragCallbackFunction} callback This argument is invoked during drag.
|
|
67
|
+
* @return {TimeOverview} Return value is for method chain.
|
|
68
|
+
*/
|
|
69
|
+
drag(callback?: DragCallbackFunction): TimeOverview;
|
|
70
|
+
/** @override */
|
|
71
|
+
clear(): TimeOverview;
|
|
72
|
+
/** @override */
|
|
73
|
+
activate(): TimeOverview;
|
|
74
|
+
/** @override */
|
|
75
|
+
deactivate(): TimeOverview;
|
|
76
|
+
/**
|
|
77
|
+
* This method visualizes audio wave overview to Canvas.
|
|
78
|
+
* @param {Float32Array} data This argument is audio data for visualization.
|
|
79
|
+
* @override
|
|
80
|
+
*/
|
|
81
|
+
protected visualizeOnCanvas(data: Float32Array, _minDecibels?: number, _maxDecibels?: number): void;
|
|
82
|
+
/**
|
|
83
|
+
* This method visualizes audio wave overview to SVG.
|
|
84
|
+
* @param {Float32Array} data This argument is audio data for visualization.
|
|
85
|
+
* @override
|
|
86
|
+
*/
|
|
87
|
+
protected visualizeBySVG(data: Float32Array, _minDecibels?: number, _maxDecibels?: number): void;
|
|
88
|
+
/**
|
|
89
|
+
* This method visualizes rectangle for audio current time.
|
|
90
|
+
* @param {MouseEvent|TouchEvent} event This argument is instance of `MouseEvent` or `TouchEvent`.
|
|
91
|
+
* @param {MouseEventTypes} type This argument is one of 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend'.
|
|
92
|
+
* @param {number} offsetX This argument is X coordinate on Canvas or SVG from window.
|
|
93
|
+
*/
|
|
94
|
+
private visualize;
|
|
95
|
+
/**
|
|
96
|
+
* This method is event listener for visualizing rectangle.
|
|
97
|
+
* @param {MouseEvent} event This argument is instance of `MouseEvent`.
|
|
98
|
+
*/
|
|
99
|
+
private onMouseStart;
|
|
100
|
+
/**
|
|
101
|
+
* This method is event listener for visualizing rectangle.
|
|
102
|
+
* @param {MouseEvent} event This argument is instance of `MouseEvent`.
|
|
103
|
+
*/
|
|
104
|
+
private onMouseMove;
|
|
105
|
+
/**
|
|
106
|
+
* This method is event listener for visualizing rectangle.
|
|
107
|
+
* @param {MouseEvent} event This argument is instance of `MouseEvent`.
|
|
108
|
+
*/
|
|
109
|
+
private onMouseUp;
|
|
110
|
+
/**
|
|
111
|
+
* This method is event listener for visualizing rectangle.
|
|
112
|
+
* @param {TouchEvent} event This argument is instance of `TouchEvent`.
|
|
113
|
+
*/
|
|
114
|
+
private onTouchStart;
|
|
115
|
+
/**
|
|
116
|
+
* This method is event listener for visualizing rectangle.
|
|
117
|
+
* @param {TouchEvent} event This argument is instance of `TouchEvent`.
|
|
118
|
+
*/
|
|
119
|
+
private onTouchMove;
|
|
120
|
+
/**
|
|
121
|
+
* This method is event listener for visualizing rectangle.
|
|
122
|
+
* @param {TouchEvent} event This argument is instance of `TouchEvent`.
|
|
123
|
+
*/
|
|
124
|
+
private onTouchEnd;
|
|
125
|
+
/**
|
|
126
|
+
* This method returns X coordinate from instance of `MouseEvent` or `TouchEvent`.
|
|
127
|
+
* @param {MouseEvent|TouchEvent} event This argument is instance of `MouseEvent` or `TouchEvent`.
|
|
128
|
+
* @return {number} Return value is X coordinate as mouse or touch position.
|
|
129
|
+
*/
|
|
130
|
+
private getOffsetX;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=TimeOverview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeOverview.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Analyser/TimeOverview.ts"],"names":[],"mappings":"AAAA,OAA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,WAAW;IAgBnB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAYlB;;;;OAIG;IACH,OAAO,CAAC,UAAU;CAWnB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Statable } from '../../interfaces';
|
|
2
|
+
import { Channel } from '../Analyser';
|
|
3
|
+
export declare type Color = string;
|
|
4
|
+
export declare type GraphicsApi = 'canvas' | 'svg' | '';
|
|
5
|
+
export declare type Gradient = {
|
|
6
|
+
offset: number;
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type Gradients = Gradient[];
|
|
10
|
+
export declare type Shape = 'line' | 'rect';
|
|
11
|
+
export declare type Font = {
|
|
12
|
+
family?: string;
|
|
13
|
+
size?: string;
|
|
14
|
+
style?: string;
|
|
15
|
+
weight?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare type GraphicsStyles = {
|
|
18
|
+
shape?: Shape;
|
|
19
|
+
gradients?: Gradients;
|
|
20
|
+
wave?: Color;
|
|
21
|
+
grid?: Color;
|
|
22
|
+
text?: Color;
|
|
23
|
+
font?: Font;
|
|
24
|
+
width?: number;
|
|
25
|
+
cap?: CanvasLineCap;
|
|
26
|
+
join?: CanvasLineJoin;
|
|
27
|
+
top?: number;
|
|
28
|
+
right?: number;
|
|
29
|
+
bottom?: number;
|
|
30
|
+
left?: number;
|
|
31
|
+
};
|
|
32
|
+
export declare type VisualizerParams = {
|
|
33
|
+
interval?: number;
|
|
34
|
+
styles?: GraphicsStyles;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* This private class is superclass for visualizer class (`TimeOverview`, `Time`, `FFT`).
|
|
38
|
+
* @constructor
|
|
39
|
+
* @implements {Statable}
|
|
40
|
+
*/
|
|
41
|
+
export declare class Visualizer implements Statable {
|
|
42
|
+
static readonly XMLNS: "http://www.w3.org/2000/svg";
|
|
43
|
+
static readonly XLINK: "http://www.w3.org/1999/xlink";
|
|
44
|
+
protected static SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW: string;
|
|
45
|
+
protected static SVG_LINEAR_GRADIENT_ID_TIME: string;
|
|
46
|
+
protected static SVG_LINEAR_GRADIENT_ID_FFT: string;
|
|
47
|
+
protected sampleRate: number;
|
|
48
|
+
protected channel: Channel;
|
|
49
|
+
protected isActive: boolean;
|
|
50
|
+
protected graphics: GraphicsApi;
|
|
51
|
+
protected canvas: HTMLCanvasElement | null;
|
|
52
|
+
protected context: CanvasRenderingContext2D | null;
|
|
53
|
+
protected svg: SVGSVGElement | null;
|
|
54
|
+
protected interval: number;
|
|
55
|
+
protected styles: GraphicsStyles;
|
|
56
|
+
/**
|
|
57
|
+
* @param {number} sampleRate This argument is sample rate.
|
|
58
|
+
*/
|
|
59
|
+
constructor(sampleRate: number, channel: Channel);
|
|
60
|
+
/**
|
|
61
|
+
* This method sets up for using Canvas or SVG.
|
|
62
|
+
* @param {HTMLCanvasElement|SVGSVGElement} element This argument is either `HTMLCanvasElement` or `SVGSVGElement`.
|
|
63
|
+
* @return {Visualizer} Return value is for method chain.
|
|
64
|
+
*/
|
|
65
|
+
setup(element: HTMLCanvasElement | SVGSVGElement): Visualizer;
|
|
66
|
+
/**
|
|
67
|
+
* This method visualizes sound wave to Canvas or SVG. This method conceals difference of API for visualization.
|
|
68
|
+
* @param {Uint8Array|Float32Array} data This argument is sound data for visualization.
|
|
69
|
+
* @param {number} minDecibels This argument is parameter for spectrum. The default value is -100 dB.
|
|
70
|
+
* @param {number} maxDecibels This argument is parameter for spectrum. The default value is -30 dB.
|
|
71
|
+
* @return {Visualizer} Return value is for method chain.
|
|
72
|
+
*/
|
|
73
|
+
start(data: Uint8Array | Float32Array, minDecibels?: number, maxDecibels?: number): Visualizer;
|
|
74
|
+
/**
|
|
75
|
+
* This method gets or sets parameters for visualization.
|
|
76
|
+
* This method is overloaded for type interface and type check.
|
|
77
|
+
* @param {keyof VisualizerParams|VisualizerParams} params This argument is string if getter. Otherwise, setter.
|
|
78
|
+
* @return {VisualizerParams[keyof VisualizerParams]} Return value is parameter for visualization if getter.
|
|
79
|
+
*/
|
|
80
|
+
param(params: 'interval'): number;
|
|
81
|
+
param(params: 'styles'): GraphicsStyles;
|
|
82
|
+
param(params: VisualizerParams): void;
|
|
83
|
+
/**
|
|
84
|
+
* This method gets instance of `HTMLCanvasElement` or `SVGSVGElement`.
|
|
85
|
+
* @return {HTMLCanvasElement|SVGSVGElement|null}
|
|
86
|
+
*/
|
|
87
|
+
get(): HTMLCanvasElement | SVGSVGElement | null;
|
|
88
|
+
/**
|
|
89
|
+
* This method clears graphics.
|
|
90
|
+
* @return {Visualizer} Return value is for method chain.
|
|
91
|
+
*/
|
|
92
|
+
clear(): Visualizer;
|
|
93
|
+
/**
|
|
94
|
+
* This method creates visualized graphics as string (Data URL or SVG).
|
|
95
|
+
* @return {string}
|
|
96
|
+
*/
|
|
97
|
+
create(): string;
|
|
98
|
+
/**
|
|
99
|
+
* This method gets visualizer state. If returns `true`, visualizer is active.
|
|
100
|
+
* @return {boolean}
|
|
101
|
+
*/
|
|
102
|
+
state(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* This method activates visualizer.
|
|
105
|
+
* @return {Visualizer} Return value is for method chain.
|
|
106
|
+
*/
|
|
107
|
+
activate(): Visualizer;
|
|
108
|
+
/**
|
|
109
|
+
* This method deactivates visualizer.
|
|
110
|
+
* @return {Visualizer} Return value is for method chain.
|
|
111
|
+
*/
|
|
112
|
+
deactivate(): Visualizer;
|
|
113
|
+
/**
|
|
114
|
+
* This method visualizes time domain data (`Float32Array`) to Canvas.
|
|
115
|
+
* @param {CanvasRenderingContext2D} context This argument is instance of `CanvasRenderingContext2D`.
|
|
116
|
+
* @param {Float32Array} data This argument is time domain data.
|
|
117
|
+
* @param {number} innerWidth This argument is width of visualization area.
|
|
118
|
+
* @param {number} innerHeight This argument is height of visualization area.
|
|
119
|
+
* @param {number} middle This argument is middle of visualization area.
|
|
120
|
+
* @param {number} numberOfPlots This argument is interval for visualization.
|
|
121
|
+
*/
|
|
122
|
+
protected visualizeTimeDomainFloat32ArrayOnCanvas(context: CanvasRenderingContext2D, data: Float32Array, innerWidth: number, innerHeight: number, middle: number, numberOfPlots?: number): void;
|
|
123
|
+
/**
|
|
124
|
+
* This method visualizes time domain data (`Float32Array`) to SVG.
|
|
125
|
+
* @param {Float32Array} data This argument is time domain data.
|
|
126
|
+
* @param {number} innerWidth This argument is width of visualization area.
|
|
127
|
+
* @param {number} innerHeight This argument is height of visualization area.
|
|
128
|
+
* @param {number} middle This argument is middle of visualization area.
|
|
129
|
+
* @param {number} numberOfPlots This argument is interval for visualization.
|
|
130
|
+
* @param {string} linearGradientId This argument is `id` attribute for `SVGLinearGradientElement`.
|
|
131
|
+
* @return {SVGPathElement|SVGGElement} This value is instance of `SVGPathElement` or `SVGGElement`.
|
|
132
|
+
*/
|
|
133
|
+
protected visualizeTimeDomainFloat32ArrayBySVG(data: Float32Array, innerWidth: number, innerHeight: number, middle: number, numberOfPlots: number, linearGradientId: string): SVGPathElement | SVGGElement | null;
|
|
134
|
+
/**
|
|
135
|
+
* This method creates elements for SVG linear gradient.
|
|
136
|
+
* @param {string} linearGradientId This argument is `id` attribute for `SVGLinearGradientElement`.
|
|
137
|
+
* @return {SVGDefsElement} This value is as instance of `SVGDefsElement`.
|
|
138
|
+
*/
|
|
139
|
+
protected createSVGLinearGradient(linearGradientId: string): SVGDefsElement | null;
|
|
140
|
+
/**
|
|
141
|
+
* This method creates string for font styles.
|
|
142
|
+
* @return {string}
|
|
143
|
+
*/
|
|
144
|
+
protected createFontString(): string;
|
|
145
|
+
/** @abstract */
|
|
146
|
+
protected visualizeOnCanvas(data: Uint8Array | Float32Array, minDecibels?: number, maxDecibels?: number): void;
|
|
147
|
+
/** @abstract */
|
|
148
|
+
protected visualizeBySVG(data: Uint8Array | Float32Array, minDecibels?: number, maxDecibels?: number): void;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=Visualizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,IAAI,UAAU;IAqB1B;;;OAGG;IACI,MAAM,IAAI,MAAM;IAmBvB;;;OAGG;IACI,KAAK,IAAI,OAAO;IAIvB;;;OAGG;IACI,QAAQ,IAAI,UAAU;IAM7B;;;OAGG;IACI,UAAU,IAAI,UAAU;IAM/B;;;;;;;;OAQG;IACH,SAAS,CAAC,uCAAuC,CAAC,OAAO,EAAE,wBAAwB,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI;IAqE/L;;;;;;;;;OASG;IACH,SAAS,CAAC,oCAAoC,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,IAAI;IAsFjN;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IA4BlF;;;OAGG;IACH,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAIpC,gBAAgB;IAEhB,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAG9G,gBAAgB;IAEhB,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;CAE5G"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Connectable } from '../../interfaces';
|
|
2
|
+
import { Color, GraphicsApi, Gradient, Gradients, Shape, Font, GraphicsStyles } from './Visualizer';
|
|
3
|
+
import { TimeOverview, TimeOverviewParams, CurrentTimeStyles, DragMode, DragCallbackFunction } from './TimeOverview';
|
|
4
|
+
import { Time, TimeParams } from './Time';
|
|
5
|
+
import { FFT, FFTParams } from './FFT';
|
|
6
|
+
export declare type Domain = 'timeoverview' | 'time' | 'fft';
|
|
7
|
+
export declare type Channel = 0 | 1;
|
|
8
|
+
export declare type DataType = 'uint' | 'float';
|
|
9
|
+
export declare type FFTSize = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768;
|
|
10
|
+
export type { Color, GraphicsApi, Gradient, Gradients, Shape, Font, GraphicsStyles, TimeOverview, TimeOverviewParams, CurrentTimeStyles, DragMode, DragCallbackFunction, TimeParams, FFTParams };
|
|
11
|
+
export declare type AnalyserParams = {
|
|
12
|
+
fftSize?: FFTSize;
|
|
13
|
+
readonly frequencyBinCount?: number;
|
|
14
|
+
minDecibels?: number;
|
|
15
|
+
maxDecibels?: number;
|
|
16
|
+
smoothingTimeConstant?: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* This private class manages 3 private classes (`TimeOverview`, `Time`, `FFT`) for visualizing sound wave.
|
|
20
|
+
* @constructor
|
|
21
|
+
* @implements {Connectable}
|
|
22
|
+
*/
|
|
23
|
+
export declare class Analyser implements Connectable {
|
|
24
|
+
private analyser;
|
|
25
|
+
private input;
|
|
26
|
+
private timeOverviewL;
|
|
27
|
+
private timeOverviewR;
|
|
28
|
+
private time;
|
|
29
|
+
private fft;
|
|
30
|
+
private timeDomainAnimationId;
|
|
31
|
+
private timeDomainTimerId;
|
|
32
|
+
private frequencyDomainAnimationId;
|
|
33
|
+
private frequencyDomainTimerId;
|
|
34
|
+
/**
|
|
35
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
36
|
+
*/
|
|
37
|
+
constructor(context: AudioContext);
|
|
38
|
+
/**
|
|
39
|
+
* This method visualizes sound wave.
|
|
40
|
+
* @param {Domain} domain This argument is one of 'timeoverview', 'time', 'fft'.
|
|
41
|
+
* @param {Channel} channel This argument is channel number (Left: 0, Right: 1 ...).
|
|
42
|
+
* @param {AudioBuffer} buffer This argument is instance of `AudioBuffer` (If domain is 'timeoverview', this argument is required).
|
|
43
|
+
* @return {Analyser} Return value is for method chain.
|
|
44
|
+
*/
|
|
45
|
+
start(domain: Domain, channel?: Channel, buffer?: AudioBuffer): Analyser;
|
|
46
|
+
/**
|
|
47
|
+
* This method stops visualizer.
|
|
48
|
+
* @param {Domain} domain This argument is one of 'timeoverview', 'time', 'fft'.
|
|
49
|
+
* @return {Analyser} Return value is for method chain.
|
|
50
|
+
*/
|
|
51
|
+
stop(domain: Domain): Analyser;
|
|
52
|
+
/**
|
|
53
|
+
* This method gets or sets parameters for analyser.
|
|
54
|
+
* This method is overloaded for type interface and type check.
|
|
55
|
+
* @param {keyof AnalyserParams|AnalyserParams} params This argument is string if getter. Otherwise, setter.
|
|
56
|
+
* @return {AnalyserParams[keyof AnalyserParams]|Analyser} Return value is parameter for analyser if getter.
|
|
57
|
+
* Otherwise, return value is for method chain.
|
|
58
|
+
*/
|
|
59
|
+
param(params: 'fftSize'): number;
|
|
60
|
+
param(params: 'frequencyBinCount'): number;
|
|
61
|
+
param(params: 'minDecibels'): number;
|
|
62
|
+
param(params: 'maxDecibels'): number;
|
|
63
|
+
param(params: 'smoothingTimeConstant'): number;
|
|
64
|
+
param(params: AnalyserParams): Analyser;
|
|
65
|
+
/**
|
|
66
|
+
* This method selects domain for visualization.
|
|
67
|
+
* This method is overloaded for type interface and type check.
|
|
68
|
+
* @param {Domain} domain This argument is one of 'timeoverview', 'time', 'fft'.
|
|
69
|
+
* @param {Channel} channel This argument is channel number (Left: 0, Right: 1 ...).
|
|
70
|
+
* @return {TimeOverview|Time|FFT|Analyser} Return value is instance of selected `Visualizer` class.
|
|
71
|
+
*/
|
|
72
|
+
domain(domain: 'timeoverview', channel?: Channel): TimeOverview;
|
|
73
|
+
domain(domain: 'time', channel?: Channel): Time;
|
|
74
|
+
domain(domain: 'fft', channel?: Channel): FFT;
|
|
75
|
+
/**
|
|
76
|
+
* This method gets instance of `AnalyserNode`.
|
|
77
|
+
* @return {AnalyserNode}
|
|
78
|
+
*/
|
|
79
|
+
get(): AnalyserNode;
|
|
80
|
+
/** @override */
|
|
81
|
+
get INPUT(): GainNode;
|
|
82
|
+
/** @override */
|
|
83
|
+
get OUTPUT(): GainNode;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Analyser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACrH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,oBAAY,MAAM,GAAK,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC;AACvD,oBAAY,OAAO,GAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,oBAAY,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACxC,oBAAY,OAAO,GAAI,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7F,YAAY,EACV,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,kBA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;IAyC9C;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY;IAC/D,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAC/C,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,GAAG;IAuBpD;;;OAGG;IACI,GAAG,IAAI,YAAY;IAI1B,gBAAgB;IAChB,IAAW,KAAK,IAAI,QAAQ,CAE3B;IAED,gBAAgB;IAChB,IAAW,MAAM,IAAI,QAAQ,CAE5B;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Effector } from './Effector';
|
|
2
|
+
export declare type AutopannerParams = {
|
|
3
|
+
state?: boolean;
|
|
4
|
+
depth?: number;
|
|
5
|
+
rate?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Effector's subclass for Autopanner.
|
|
9
|
+
* @constructor
|
|
10
|
+
* @extends {Effector}
|
|
11
|
+
*/
|
|
12
|
+
export declare class Autopanner extends Effector {
|
|
13
|
+
private panner;
|
|
14
|
+
/**
|
|
15
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
16
|
+
*/
|
|
17
|
+
constructor(context: AudioContext);
|
|
18
|
+
/** @override */
|
|
19
|
+
stop(stopTime?: number, releaseTime?: number): void;
|
|
20
|
+
/** @override */
|
|
21
|
+
connect(): GainNode;
|
|
22
|
+
/**
|
|
23
|
+
* This method gets or sets parameters for autopanner effector.
|
|
24
|
+
* This method is overloaded for type interface and type check.
|
|
25
|
+
* @param {keyof AutopannerParams|AutopannerParams} params This argument is string if getter. Otherwise, setter.
|
|
26
|
+
* @return {AutopannerParams[keyof AutopannerParams]|Autopanner} Return value is parameter for autopanner effector if getter.
|
|
27
|
+
* Otherwise, return value is for method chain.
|
|
28
|
+
*/
|
|
29
|
+
param(params: 'depth'): number;
|
|
30
|
+
param(params: 'rate'): number;
|
|
31
|
+
param(params: AutopannerParams): Autopanner;
|
|
32
|
+
/** @override */
|
|
33
|
+
params(): AutopannerParams;
|
|
34
|
+
/** @override */
|
|
35
|
+
activate(): Autopanner;
|
|
36
|
+
/** @override */
|
|
37
|
+
deactivate(): Autopanner;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=Autopanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autopanner.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Effectors/Autopanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,oBAAY,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AAEF;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,QAAQ;IACtC,OAAO,CAAC,MAAM,CAAmB;IAEjC;;OAEG;gBACS,OAAO,EAAE,YAAY;IAmBjC,gBAAgB;IACA,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAUnE,gBAAgB;IACA,OAAO,IAAI,QAAQ;IAqBnC;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;IAC9B,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAC7B,KAAK,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IAmClD,gBAAgB;IACA,MAAM,IAAI,gBAAgB;IAQ1C,gBAAgB;IACA,QAAQ,IAAI,UAAU;IAKtC,gBAAgB;IACA,UAAU,IAAI,UAAU;CAIzC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Effector } from './Effector';
|
|
2
|
+
export declare type ChorusParams = {
|
|
3
|
+
state?: boolean;
|
|
4
|
+
time?: number;
|
|
5
|
+
depth?: number;
|
|
6
|
+
rate?: number;
|
|
7
|
+
mix?: number;
|
|
8
|
+
tone?: number;
|
|
9
|
+
feedback?: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Effector's subclass for Chorus.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @extends {Effector}
|
|
15
|
+
*/
|
|
16
|
+
export declare class Chorus extends Effector {
|
|
17
|
+
private delay;
|
|
18
|
+
private tone;
|
|
19
|
+
private mix;
|
|
20
|
+
private feedback;
|
|
21
|
+
private depthRate;
|
|
22
|
+
/**
|
|
23
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
24
|
+
*/
|
|
25
|
+
constructor(context: AudioContext);
|
|
26
|
+
/** @override */
|
|
27
|
+
stop(stopTime?: number, releaseTime?: number): void;
|
|
28
|
+
/** @override */
|
|
29
|
+
connect(): GainNode;
|
|
30
|
+
/**
|
|
31
|
+
* This method gets or sets parameters for chorus effector.
|
|
32
|
+
* This method is overloaded for type interface and type check.
|
|
33
|
+
* @param {keyof ChorusParams|ChorusParams} params This argument is string if getter. Otherwise, setter.
|
|
34
|
+
* @return {ChorusParams[keyof ChorusParams]|Chorus} Return value is parameter for chorus effector if getter.
|
|
35
|
+
* Otherwise, return value is for method chain.
|
|
36
|
+
*/
|
|
37
|
+
param(params: 'time'): number;
|
|
38
|
+
param(params: 'depth'): number;
|
|
39
|
+
param(params: 'rate'): number;
|
|
40
|
+
param(params: 'mix'): number;
|
|
41
|
+
param(params: 'tone'): number;
|
|
42
|
+
param(params: 'feedback'): number;
|
|
43
|
+
param(params: ChorusParams): Chorus;
|
|
44
|
+
/** @override */
|
|
45
|
+
params(): ChorusParams;
|
|
46
|
+
/** @override */
|
|
47
|
+
activate(): Chorus;
|
|
48
|
+
/** @override */
|
|
49
|
+
deactivate(): Chorus;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=Chorus.d.ts.map
|
|
@@ -0,0 +1 @@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gB;IACA,QAAQ,IAAI,MAAM;IAKlC,gBAAgB;IACA,UAAU,IAAI,MAAM;CAIrC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Effector } from './Effector';
|
|
2
|
+
export declare type CompressorParams = {
|
|
3
|
+
state?: boolean;
|
|
4
|
+
threshold?: number;
|
|
5
|
+
knee?: number;
|
|
6
|
+
ratio?: number;
|
|
7
|
+
attack?: number;
|
|
8
|
+
release?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Effector's subclass for Compressor.
|
|
12
|
+
* @constructor
|
|
13
|
+
* @extends {Effector}
|
|
14
|
+
*/
|
|
15
|
+
export declare class Compressor extends Effector {
|
|
16
|
+
private compressor;
|
|
17
|
+
/**
|
|
18
|
+
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
19
|
+
*/
|
|
20
|
+
constructor(context: AudioContext);
|
|
21
|
+
/** @override */
|
|
22
|
+
connect(): GainNode;
|
|
23
|
+
/**
|
|
24
|
+
* This method gets or sets parameters for compressor.
|
|
25
|
+
* This method is overloaded for type interface and type check.
|
|
26
|
+
* @param {keyof CompressorParams|CompressorParams} params This argument is string if getter. Otherwise, setter.
|
|
27
|
+
* @return {CompressorParams[keyof CompressorParams]|Compressor} Return value is parameter for compressor if getter.
|
|
28
|
+
* Otherwise, return value is for method chain.
|
|
29
|
+
*/
|
|
30
|
+
param(params: 'threshold'): number;
|
|
31
|
+
param(params: 'knee'): number;
|
|
32
|
+
param(params: 'ratio'): number;
|
|
33
|
+
param(params: 'attack'): number;
|
|
34
|
+
param(params: 'release'): number;
|
|
35
|
+
param(params: CompressorParams): Compressor;
|
|
36
|
+
/** @override */
|
|
37
|
+
params(): CompressorParams;
|
|
38
|
+
/** @override */
|
|
39
|
+
activate(): Compressor;
|
|
40
|
+
/** @override */
|
|
41
|
+
deactivate(): Compressor;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=Compressor.d.ts.map
|