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.
Files changed (121) hide show
  1. package/README.md +57 -28
  2. package/build/types/AudioModule/index.d.ts +198 -0
  3. package/build/types/AudioModule/index.d.ts.map +1 -0
  4. package/build/types/MIDI/index.d.ts +48 -0
  5. package/build/types/MIDI/index.d.ts.map +1 -0
  6. package/build/types/MML/Part.d.ts +78 -0
  7. package/build/types/MML/Part.d.ts.map +1 -0
  8. package/build/types/MML/Sequence.d.ts +66 -0
  9. package/build/types/MML/Sequence.d.ts.map +1 -0
  10. package/build/types/MML/Sequencer.d.ts +34 -0
  11. package/build/types/MML/Sequencer.d.ts.map +1 -0
  12. package/build/types/MML/Token.d.ts +40 -0
  13. package/build/types/MML/Token.d.ts.map +1 -0
  14. package/build/types/MML/Tokenizer.d.ts +21 -0
  15. package/build/types/MML/Tokenizer.d.ts.map +1 -0
  16. package/build/types/MML/Tree.d.ts +60 -0
  17. package/build/types/MML/Tree.d.ts.map +1 -0
  18. package/build/types/MML/TreeConstructor.d.ts +25 -0
  19. package/build/types/MML/TreeConstructor.d.ts.map +1 -0
  20. package/build/types/MML/index.d.ts +115 -0
  21. package/build/types/MML/index.d.ts.map +1 -0
  22. package/build/types/MediaModule/index.d.ts +223 -0
  23. package/build/types/MediaModule/index.d.ts.map +1 -0
  24. package/build/types/MixerModule/index.d.ts +99 -0
  25. package/build/types/MixerModule/index.d.ts.map +1 -0
  26. package/build/types/NoiseModule/index.d.ts +106 -0
  27. package/build/types/NoiseModule/index.d.ts.map +1 -0
  28. package/build/types/OneshotModule/index.d.ts +176 -0
  29. package/build/types/OneshotModule/index.d.ts.map +1 -0
  30. package/build/types/OscillatorModule/Glide.d.ts +47 -0
  31. package/build/types/OscillatorModule/Glide.d.ts.map +1 -0
  32. package/build/types/OscillatorModule/Oscillator.d.ts +77 -0
  33. package/build/types/OscillatorModule/Oscillator.d.ts.map +1 -0
  34. package/build/types/OscillatorModule/index.d.ts +138 -0
  35. package/build/types/OscillatorModule/index.d.ts.map +1 -0
  36. package/build/types/ProcessorModule/index.d.ts +124 -0
  37. package/build/types/ProcessorModule/index.d.ts.map +1 -0
  38. package/build/types/SoundModule/Analyser/FFT.d.ts +61 -0
  39. package/build/types/SoundModule/Analyser/FFT.d.ts.map +1 -0
  40. package/build/types/SoundModule/Analyser/Time.d.ts +54 -0
  41. package/build/types/SoundModule/Analyser/Time.d.ts.map +1 -0
  42. package/build/types/SoundModule/Analyser/TimeOverview.d.ts +132 -0
  43. package/build/types/SoundModule/Analyser/TimeOverview.d.ts.map +1 -0
  44. package/build/types/SoundModule/Analyser/Visualizer.d.ts +150 -0
  45. package/build/types/SoundModule/Analyser/Visualizer.d.ts.map +1 -0
  46. package/build/types/SoundModule/Analyser/index.d.ts +85 -0
  47. package/build/types/SoundModule/Analyser/index.d.ts.map +1 -0
  48. package/build/types/SoundModule/Effectors/Autopanner.d.ts +39 -0
  49. package/build/types/SoundModule/Effectors/Autopanner.d.ts.map +1 -0
  50. package/build/types/SoundModule/Effectors/Chorus.d.ts +51 -0
  51. package/build/types/SoundModule/Effectors/Chorus.d.ts.map +1 -0
  52. package/build/types/SoundModule/Effectors/Compressor.d.ts +43 -0
  53. package/build/types/SoundModule/Effectors/Compressor.d.ts.map +1 -0
  54. package/build/types/SoundModule/Effectors/Delay.d.ts +48 -0
  55. package/build/types/SoundModule/Effectors/Delay.d.ts.map +1 -0
  56. package/build/types/SoundModule/Effectors/Distortion.d.ts +90 -0
  57. package/build/types/SoundModule/Effectors/Distortion.d.ts.map +1 -0
  58. package/build/types/SoundModule/Effectors/Effector.d.ts +79 -0
  59. package/build/types/SoundModule/Effectors/Effector.d.ts.map +1 -0
  60. package/build/types/SoundModule/Effectors/EnvelopeGenerator.d.ts +90 -0
  61. package/build/types/SoundModule/Effectors/EnvelopeGenerator.d.ts.map +1 -0
  62. package/build/types/SoundModule/Effectors/Equalizer.d.ts +44 -0
  63. package/build/types/SoundModule/Effectors/Equalizer.d.ts.map +1 -0
  64. package/build/types/SoundModule/Effectors/Filter.d.ts +61 -0
  65. package/build/types/SoundModule/Effectors/Filter.d.ts.map +1 -0
  66. package/build/types/SoundModule/Effectors/Flanger.d.ts +51 -0
  67. package/build/types/SoundModule/Effectors/Flanger.d.ts.map +1 -0
  68. package/build/types/SoundModule/Effectors/Listener.d.ts +47 -0
  69. package/build/types/SoundModule/Effectors/Listener.d.ts.map +1 -0
  70. package/build/types/SoundModule/Effectors/Panner.d.ts +68 -0
  71. package/build/types/SoundModule/Effectors/Panner.d.ts.map +1 -0
  72. package/build/types/SoundModule/Effectors/Phaser.d.ts +55 -0
  73. package/build/types/SoundModule/Effectors/Phaser.d.ts.map +1 -0
  74. package/build/types/SoundModule/Effectors/PitchShifter.d.ts +42 -0
  75. package/build/types/SoundModule/Effectors/PitchShifter.d.ts.map +1 -0
  76. package/build/types/SoundModule/Effectors/Reverb.d.ts +81 -0
  77. package/build/types/SoundModule/Effectors/Reverb.d.ts.map +1 -0
  78. package/build/types/SoundModule/Effectors/Ringmodulator.d.ts +39 -0
  79. package/build/types/SoundModule/Effectors/Ringmodulator.d.ts.map +1 -0
  80. package/build/types/SoundModule/Effectors/Stereo.d.ts +45 -0
  81. package/build/types/SoundModule/Effectors/Stereo.d.ts.map +1 -0
  82. package/build/types/SoundModule/Effectors/Tremolo.d.ts +41 -0
  83. package/build/types/SoundModule/Effectors/Tremolo.d.ts.map +1 -0
  84. package/build/types/SoundModule/Effectors/VocalCanceler.d.ts +31 -0
  85. package/build/types/SoundModule/Effectors/VocalCanceler.d.ts.map +1 -0
  86. package/build/types/SoundModule/Effectors/Wah.d.ts +49 -0
  87. package/build/types/SoundModule/Effectors/Wah.d.ts.map +1 -0
  88. package/build/types/SoundModule/Recorder/Channel.d.ts +44 -0
  89. package/build/types/SoundModule/Recorder/Channel.d.ts.map +1 -0
  90. package/build/types/SoundModule/Recorder/Track.d.ts +36 -0
  91. package/build/types/SoundModule/Recorder/Track.d.ts.map +1 -0
  92. package/build/types/SoundModule/Recorder/index.d.ts +118 -0
  93. package/build/types/SoundModule/Recorder/index.d.ts.map +1 -0
  94. package/build/types/SoundModule/Session/Room.d.ts +69 -0
  95. package/build/types/SoundModule/Session/Room.d.ts.map +1 -0
  96. package/build/types/SoundModule/Session/index.d.ts +94 -0
  97. package/build/types/SoundModule/Session/index.d.ts.map +1 -0
  98. package/build/types/SoundModule/index.d.ts +147 -0
  99. package/build/types/SoundModule/index.d.ts.map +1 -0
  100. package/build/types/StreamModule/NoiseGate.d.ts +29 -0
  101. package/build/types/StreamModule/NoiseGate.d.ts.map +1 -0
  102. package/build/types/StreamModule/NoiseSuppressor.d.ts +30 -0
  103. package/build/types/StreamModule/NoiseSuppressor.d.ts.map +1 -0
  104. package/build/types/StreamModule/index.d.ts +175 -0
  105. package/build/types/StreamModule/index.d.ts.map +1 -0
  106. package/build/types/XSound/index.d.ts +155 -0
  107. package/build/types/XSound/index.d.ts.map +1 -0
  108. package/build/types/interfaces.d.ts +23 -0
  109. package/build/types/interfaces.d.ts.map +1 -0
  110. package/build/types/main.d.ts +117 -0
  111. package/build/types/main.d.ts.map +1 -0
  112. package/build/types/types.d.ts +10 -0
  113. package/build/types/types.d.ts.map +1 -0
  114. package/build/xsound.js +1 -1
  115. package/build/xsound.js.LICENSE.txt +1 -1
  116. package/build/xsound.js.map +1 -1
  117. package/build/xsound.min.js +3 -0
  118. package/build/xsound.min.js.LICENSE.txt +1 -0
  119. package/build/xsound.min.js.map +1 -0
  120. package/package.json +36 -30
  121. package/build/xsound.d.ts +0 -3
@@ -0,0 +1,155 @@
1
+ export declare const EQUAL_TEMPERAMENT = 12;
2
+ export declare const FREQUENCY_RATIO: number;
3
+ export declare const MIN_A = 27.5;
4
+ export declare const QUARTER_NOTE = 4;
5
+ export declare const SHARP = "#";
6
+ export declare const HALF_UP = "+";
7
+ export declare const HALF_DOWN = "-";
8
+ export declare const DOT = ".";
9
+ export declare type PitchChar = 'C' | 'D' | 'E' | 'F' | 'G' | 'A' | 'B' | 'R';
10
+ /**
11
+ * This predicate method determine whether is `PitchChar` type.
12
+ * @param {string} pitchChar This argument is any string.
13
+ * @return {boolean}
14
+ */
15
+ export declare function isPitchChar(pitchChar: string): pitchChar is PitchChar;
16
+ /**
17
+ * This class (static) method computes index by octave and `PitchChar` string.
18
+ * @param {number} octave This argument is octave.
19
+ * @param {PitchChar} pitchChar This argument is `PitchChar` string.
20
+ * @return {number} Return value is index that is computed by octave and pitch character.
21
+ */
22
+ export declare function computeIndex(octave: number, pitchChar: PitchChar): number;
23
+ /**
24
+ * This class (static) method computes frequency from index that corresponds to 12 equal temperament.
25
+ * @param {number} index This argument is index that corresponds to 12 equal temperament.
26
+ * For example, this value is between 0 and 88 in case of piano.
27
+ * @return {number} Return value is frequency.
28
+ */
29
+ export declare function computeFrequency(index: number): number;
30
+ export interface FileEvent extends Event {
31
+ target: HTMLInputElement & EventTarget;
32
+ }
33
+ export declare type FileReadType = 'arraybuffer' | 'dataURL' | 'text' | 'json';
34
+ export declare type FileReaderErrorText = 'NOT_FOUND_ERR' | 'SECURITY_ERR' | 'ABORT_ERR' | 'NOT_READABLE_ERR' | 'ERR' | '';
35
+ /**
36
+ * This class (static) method executes FFT.
37
+ * @param {Float32Array} reals This argument is instance of `Float32Array` for real number.
38
+ * @param {Float32Array} imags This argument is instance of `Float32Array` for imaginary number.
39
+ * @param {number} size This argument is FFT size (power of two).
40
+ */
41
+ export declare function FFT(reals: Float32Array, imags: Float32Array, size: number): void;
42
+ /**
43
+ * This class (static) method executes IFFT.
44
+ * @param {Float32Array} reals This argument is instance of `Float32Array` for real number.
45
+ * @param {Float32Array} imags This argument is instance of `Float32Array` for imaginary number.
46
+ * @param {number} size This argument is IFFT size (power of two).
47
+ */
48
+ export declare function IFFT(reals: Float32Array, imags: Float32Array, size: number): void;
49
+ /**
50
+ * This class (static) method retrieves resource on web by Ajax.
51
+ * @param {string} url This argument is URL for resource.
52
+ * @param {XMLHttpRequestResponseType} type This argument is response type that is one of 'arraybuffer', 'blob', 'document', 'json', 'text'. The default value is 'arraybuffer'.
53
+ * @param {number} timeout This argument is timeout of Ajax. The default value is 60000 msec (1 minutes).
54
+ * @param {function} successCallback This argument is invoked on success.
55
+ * @param {function} errorCallback This argument is invoked on failure.
56
+ * @param {function} progressCallback This argument is invoked during receiving data.
57
+ */
58
+ export declare function ajax(params: {
59
+ url: string;
60
+ type?: XMLHttpRequestResponseType;
61
+ timeout?: number;
62
+ successCallback?(event: ProgressEvent, respsonse: ArrayBuffer | Blob | Document | string): void;
63
+ errorCallback?(event: ProgressEvent, textStatus: 'error' | 'timeout'): void;
64
+ progressCallback?(event: ProgressEvent): void;
65
+ }): void;
66
+ /**
67
+ * This class (static) method calculates minutes, seconds and milliseconds from designated time (seconds).
68
+ * @param {number} time This argument is time (seconds).
69
+ * @return {{ minutes: number; seconds: number; milliseconds: number; }} Return value is converted time as associative array
70
+ */
71
+ export declare function convertTime(time: number): {
72
+ minutes: number;
73
+ seconds: number;
74
+ milliseconds: number;
75
+ };
76
+ /**
77
+ * This class (static) method decodes instance of `ArrayBuffer` to instance of `AudioBuffer`.
78
+ * @param {AudioContext} context This argument is instance of `AudioContext` for `decodeAudioData` method.
79
+ * @param {ArrayBuffer} arraybuffer This argument is decoded to instance of `AudioBuffer`.
80
+ * @param {function} successCallback This argument is invoked on success.
81
+ * @param {function} errorCallback This argument is invoked on failure.
82
+ */
83
+ export declare function decode(context: AudioContext, arraybuffer: ArrayBuffer, successCallback?: (buffer: AudioBuffer) => void, errorCallback?: (error: Error) => void): void;
84
+ /**
85
+ * This class (static) method shows designated `Element` in full screen.
86
+ * @param {Element} element This argument is instance of `Element` that is target of full screen.
87
+ * @return {Promise} Return value is instance of `Promise`.
88
+ */
89
+ export declare function requestFullscreen(element: Element): Promise<void>;
90
+ /**
91
+ * This class (static) method shows `Document` in original size from full screen.
92
+ * @return {Promise} Return value is instance of `Promise`.
93
+ */
94
+ export declare function exitFullscreen(): Promise<void>;
95
+ /**
96
+ * This class (static) method reads file.
97
+ * @param {File} file This argument is instance of `File`.
98
+ * @param {FileReadType} type This argument is one of 'arraybuffer', 'dataURL', 'text', 'json'.
99
+ * @param {function} successCallback This argument is invoked on success.
100
+ * @param {function} errorCallback This argument is invoked on failure.
101
+ * @param {function} progressCallback This argument is invoked as `onprogress` event handler in instance of `FileReader`.
102
+ */
103
+ export declare function read(params: {
104
+ file: File;
105
+ type: FileReadType;
106
+ successCallback?(event: Event, result: ArrayBuffer | string | null): void;
107
+ errorCallback?(event: Event, textStatus: FileReaderErrorText): void;
108
+ progressCallback?(event: Event): void;
109
+ }): void;
110
+ /**
111
+ * This class (static) method gets instance of `File` from `DataTransfer`.
112
+ * @param {DragEvent} event This argument is instance of `DragEvent`.
113
+ * @param {FileReadType|string} type This argument is one of 'arraybuffer', 'dataURL', 'objectURL', 'text', 'json'.
114
+ * @param {function} successCallback This argument is invoked on success.
115
+ * @param {function} errorCallback This argument is invoked on failure.
116
+ * @param {function} progressCallback This argument is invoked as `onprogress` event handler in instance of `FileReader`.
117
+ * @return {string|File|Error} Return value is Object URL or instance of `File` on success. Otherwise, instance of `Error`.
118
+ */
119
+ export declare function drop(params: {
120
+ event: DragEvent;
121
+ type: FileReadType | 'objectURL';
122
+ successCallback?(event: Event, result: ArrayBuffer | string | null): void;
123
+ errorCallback?(event: Event, textStatus: FileReaderErrorText): void;
124
+ progressCallback?(event: ProgressEvent): void;
125
+ }): string | File | Error;
126
+ /**
127
+ * This class (static) method gets instance of `File`.
128
+ * @param {Event} event This argument is instance of `Event` by `HTMLInputElement`.
129
+ * @param {FileReadType|string} type This argument is one of 'arraybuffer', 'dataURL', 'objectURL', 'text', 'json'.
130
+ * @param {function} successCallback This argument is invoked on success.
131
+ * @param {function} errorCallback This argument is invoked on failure.
132
+ * @param {function} progressCallback This argument is invoked as `onprogress` event handler in instance of `FileReader`.
133
+ * @return {string|File|Error} Return value is Object URL or instance of `File` on success. Otherwise, instance of `Error`.
134
+ */
135
+ export declare function file(params: {
136
+ event: FileEvent;
137
+ type: FileReadType | 'objectURL';
138
+ successCallback?(event: Event, result: ArrayBuffer | string | null): void;
139
+ errorCallback?(event: Event, textStatus: FileReaderErrorText): void;
140
+ progressCallback?(event: ProgressEvent): void;
141
+ }): string | File | Error;
142
+ /**
143
+ * This class (static) method calculates frequency from index that corresponds to 12 equal temperament.
144
+ * @param {Array<number>} indexes This argument is array that contains index that corresponds to 12 equal temperament.
145
+ * For example, this value is between 0 and 88 in case of piano.
146
+ * @return {Array<number>} Return value is array that contains frequency.
147
+ */
148
+ export declare function toFrequencies(indexes: number[]): number[];
149
+ /**
150
+ * This class (static) method creates text file.
151
+ * @param {string} text This argument is string.
152
+ * @return {string} Return value is text file as Data URL.
153
+ */
154
+ export declare function toTextFile(text: string): string;
155
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/XSound/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,eAAe,QAAiC,CAAC;AAC9D,eAAO,MAAM,KAAK,OAAmB,CAAC;AACtC,eAAO,MAAM,YAAY,IAAS,CAAC;AACnC,eAAO,MAAM,KAAK,MAAkB,CAAC;AACrC,eAAO,MAAM,OAAO,MAAgB,CAAC;AACrC,eAAO,MAAM,SAAS,MAAc,CAAC;AACrC,eAAO,MAAM,GAAG,MAAoB,CAAC;AAErC,oBAAY,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,SAAS,CAcrE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,S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AAG,IAAI,GAAG,KAAK,CAoCxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,YAAY,GAAG,WAAW,CAAC;IACjC,eAAe,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1E,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACpE,gBAAgB,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;CAC/C,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAmCxB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA0B/C"}
@@ -0,0 +1,23 @@
1
+ import { Visualizer } from './SoundModule/Analyser/Visualizer';
2
+ import { Effector } from './SoundModule/Effectors/Effector';
3
+ import { Oscillator } from './OscillatorModule/Oscillator';
4
+ /**
5
+ * This interface is implemented by some classes that abstract `AudioNode` connections (such as `Effector` class).
6
+ *
7
+ * @interface
8
+ */
9
+ export interface Connectable {
10
+ get INPUT(): AudioNode | null;
11
+ get OUTPUT(): AudioNode | null;
12
+ }
13
+ /**
14
+ * This interface is implemented by some classes that have active or inactive status.
15
+ *
16
+ * @interface
17
+ */
18
+ export interface Statable {
19
+ state(): boolean;
20
+ activate(): Visualizer | Effector | Oscillator;
21
+ deactivate(): Visualizer | Effector | Oscillator;
22
+ }
23
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,KAAK,IAAI,SAAS,GAAG,IAAI,CAAC;IAC9B,IAAI,MAAM,IAAI,SAAS,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,IAAI,OAAO,CAAC;IACjB,QAAQ,IAAI,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC/C,UAAU,IAAI,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;CAClD"}
@@ -0,0 +1,117 @@
1
+ import './types';
2
+ import { OscillatorModule, OscillatorModuleParams, GlideParams, OscillatorParams } from './OscillatorModule';
3
+ import { OneshotModule, OneshotModuleParams, OneshotSetting, OneshotSettings } from './OneshotModule';
4
+ import { NoiseModule, NoiseModuleParams, NoiseType } from './NoiseModule';
5
+ import { AudioModule, AudioModuleParams, AudioBufferSprite } from './AudioModule';
6
+ import { MediaModule, MediaModuleParams } from './MediaModule';
7
+ import { StreamModule, StreamModuleParams, NoiseGateParams, NoiseSuppressorParams } from './StreamModule';
8
+ import { ProcessorModule } from './ProcessorModule';
9
+ import { MixerModule } from './MixerModule';
10
+ import { MIDI, MIDIAccess, MIDIOptions, MIDIInput, MIDIOutput, MIDIMessageEvent } from './MIDI';
11
+ import { MML, Part, Sequence, MMLSyntaxError, Tree, TokenType, TokenMap, Token } from './MML';
12
+ import { AnalyserParams, DataType, Channel, Domain, Color, GraphicsApi, Gradient, Gradients, Shape, Font, GraphicsStyles, TimeOverview, TimeOverviewParams, DragMode, DragCallbackFunction, CurrentTimeStyles, TimeParams, FFTParams } from './SoundModule/Analyser';
13
+ import { RecorderParams, RecordType, ChannelNumber, QuantizationBit, WaveExportType } from './SoundModule/Recorder';
14
+ import { SessionParams, NumberOfSessionChannels } from './SoundModule/Session';
15
+ import { AutopannerParams } from './SoundModule/Effectors/Autopanner';
16
+ import { ChorusParams } from './SoundModule/Effectors/Chorus';
17
+ import { CompressorParams } from './SoundModule/Effectors/Compressor';
18
+ import { DelayParams } from './SoundModule/Effectors/Delay';
19
+ import { DistortionParams, DistortionType, DistortionCurve } from './SoundModule/Effectors/Distortion';
20
+ import { EqualizerParams } from './SoundModule/Effectors/Equalizer';
21
+ import { FilterParams } from './SoundModule/Effectors/Filter';
22
+ import { FlangerParams } from './SoundModule/Effectors/Flanger';
23
+ import { ListenerParams } from './SoundModule/Effectors/Listener';
24
+ import { PannerParams, Position3D } from './SoundModule/Effectors/Panner';
25
+ import { PhaserParams, PhaserNumberOfStages } from './SoundModule/Effectors/Phaser';
26
+ import { PitchShifterParams } from './SoundModule/Effectors/PitchShifter';
27
+ import { ReverbParams } from './SoundModule/Effectors/Reverb';
28
+ import { RingmodulatorParams } from './SoundModule/Effectors/Ringmodulator';
29
+ import { StereoParams } from './SoundModule/Effectors/Stereo';
30
+ import { TremoloParams } from './SoundModule/Effectors/Tremolo';
31
+ import { WahParams } from './SoundModule/Effectors/Wah';
32
+ import { FileEvent, FileReadType, FileReaderErrorText } from './XSound';
33
+ export declare type Source = OscillatorModule | OneshotModule | NoiseModule | AudioModule | MediaModule | StreamModule | ProcessorModule | MixerModule | MIDI | MML;
34
+ export declare type SourceName = 'oscillator' | 'oneshot' | 'noise' | 'audio' | 'media' | 'stream' | 'processor' | 'mixer' | 'midi' | 'mml';
35
+ /**
36
+ * This function gets instance of `Source`.
37
+ * This functions is overloaded for type interface and type check.
38
+ * @param {SourceName|string} sourceName This argument selects instance for sound source.
39
+ * @return {Source|null}
40
+ */
41
+ declare function XSound(sourceName: 'oscillator'): OscillatorModule;
42
+ declare function XSound(sourceName: 'oneshot'): OneshotModule;
43
+ declare function XSound(sourceName: 'noise'): NoiseModule;
44
+ declare function XSound(sourceName: 'audio'): AudioModule;
45
+ declare function XSound(sourceName: 'media'): MediaModule;
46
+ declare function XSound(sourceName: 'stream'): StreamModule;
47
+ declare function XSound(sourceName: 'processor'): ProcessorModule;
48
+ declare function XSound(sourceName: 'mixer'): MixerModule;
49
+ declare function XSound(sourceName: 'midi'): MIDI;
50
+ declare function XSound(sourceName: 'mml'): MML;
51
+ declare namespace XSound {
52
+ var SAMPLE_RATE: number;
53
+ var EQUAL_TEMPERAMENT: number;
54
+ var FREQUENCY_RATIO: number;
55
+ var MIN_A: number;
56
+ var QUARTER_NOT: number;
57
+ var HALF_UP: string;
58
+ var HALF_DOWN: string;
59
+ var DOT: string;
60
+ var isPitchChar: typeof import("./XSound").isPitchChar;
61
+ var computeIndex: typeof import("./XSound").computeIndex;
62
+ var computeFrequency: typeof import("./XSound").computeFrequency;
63
+ var FFT: typeof import("./XSound").FFT;
64
+ var IFFT: typeof import("./XSound").IFFT;
65
+ var ajax: typeof import("./XSound").ajax;
66
+ var convertTime: typeof import("./XSound").convertTime;
67
+ var decode: typeof import("./XSound").decode;
68
+ var requestFullscreen: typeof import("./XSound").requestFullscreen;
69
+ var exitFullscreen: typeof import("./XSound").exitFullscreen;
70
+ var read: typeof import("./XSound").read;
71
+ var drop: typeof import("./XSound").drop;
72
+ var file: typeof import("./XSound").file;
73
+ var toFrequencies: typeof import("./XSound").toFrequencies;
74
+ var toTextFile: typeof import("./XSound").toTextFile;
75
+ var Analyser: typeof import("./SoundModule/Analyser").Analyser;
76
+ var Recorder: typeof import("./SoundModule/Recorder").Recorder;
77
+ var Session: typeof import("./SoundModule/Session").Session;
78
+ var Effector: typeof import("./SoundModule/Effectors/Effector").Effector;
79
+ var Autopanner: typeof import("./SoundModule/Effectors/Autopanner").Autopanner;
80
+ var Chorus: typeof import("./SoundModule/Effectors/Chorus").Chorus;
81
+ var Compressor: typeof import("./SoundModule/Effectors/Compressor").Compressor;
82
+ var Delay: typeof import("./SoundModule/Effectors/Delay").Delay;
83
+ var Distortion: typeof import("./SoundModule/Effectors/Distortion").Distortion;
84
+ var Equalizer: typeof import("./SoundModule/Effectors/Equalizer").Equalizer;
85
+ var Filter: typeof import("./SoundModule/Effectors/Filter").Filter;
86
+ var Flanger: typeof import("./SoundModule/Effectors/Flanger").Flanger;
87
+ var Listener: typeof import("./SoundModule/Effectors/Listener").Listener;
88
+ var Panner: typeof import("./SoundModule/Effectors/Panner").Panner;
89
+ var Phaser: typeof import("./SoundModule/Effectors/Phaser").Phaser;
90
+ var PitchShifter: typeof import("./SoundModule/Effectors/PitchShifter").PitchShifter;
91
+ var Reverb: typeof import("./SoundModule/Effectors/Reverb").Reverb;
92
+ var Ringmodulator: typeof import("./SoundModule/Effectors/Ringmodulator").Ringmodulator;
93
+ var Stereo: typeof import("./SoundModule/Effectors/Stereo").Stereo;
94
+ var Tremolo: typeof import("./SoundModule/Effectors/Tremolo").Tremolo;
95
+ var Wah: typeof import("./SoundModule/Effectors/Wah").Wah;
96
+ var setup: () => Promise<void>;
97
+ var clone: () => {
98
+ (sourceName: "oscillator"): OscillatorModule;
99
+ (sourceName: "oneshot"): OneshotModule;
100
+ (sourceName: "noise"): NoiseModule;
101
+ (sourceName: "audio"): AudioModule;
102
+ (sourceName: "media"): MediaModule;
103
+ (sourceName: "stream"): StreamModule;
104
+ (sourceName: "processor"): ProcessorModule;
105
+ (sourceName: "mixer"): MixerModule;
106
+ (sourceName: "midi"): MIDI;
107
+ (sourceName: "mml"): MML;
108
+ free(unusedSources: Source[]): void;
109
+ };
110
+ var free: (unusedSources: Source[]) => void;
111
+ var noConflict: (deep: boolean) => typeof XSound;
112
+ var get: () => AudioContext;
113
+ var getCurrentTime: () => number;
114
+ }
115
+ export type { OscillatorModuleParams, GlideParams, OscillatorParams, OneshotModuleParams, OneshotSetting, OneshotSettings, NoiseModuleParams, NoiseType, AudioModuleParams, AudioBufferSprite, MediaModuleParams, StreamModuleParams, NoiseGateParams, NoiseSuppressorParams, MIDIAccess, MIDIOptions, MIDIInput, MIDIOutput, MIDIMessageEvent, Part, Sequence, MMLSyntaxError, Tree, TokenType, TokenMap, Token, AnalyserParams, DataType, Channel, Domain, Color, GraphicsApi, Gradient, Gradients, Shape, Font, GraphicsStyles, TimeOverview, TimeOverviewParams, DragMode, DragCallbackFunction, CurrentTimeStyles, TimeParams, FFTParams, RecorderParams, RecordType, ChannelNumber, QuantizationBit, WaveExportType, SessionParams, NumberOfSessionChannels, AutopannerParams, ChorusParams, CompressorParams, DelayParams, DistortionParams, DistortionType, DistortionCurve, EqualizerParams, FilterParams, FlangerParams, ListenerParams, PannerParams, Position3D, PhaserParams, PhaserNumberOfStages, PitchShifterParams, ReverbParams, RingmodulatorParams, StereoParams, TremoloParams, WahParams, FileEvent, FileReadType, FileReaderErrorText };
116
+ export { XSound, XSound as X };
117
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,UAAU,E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3
+ interface Window {
4
+ XSound?: typeof XSound;
5
+ X?: typeof XSound;
6
+ webkitAudioContext: typeof AudioContext;
7
+ }
8
+ }
9
+ export declare type BufferSize = 0 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE,OAAO,MAAM,CAAC;QACvB,CAAC,CAAC,EAAE,OAAO,MAAM,CAAC;QAClB,kBAAkB,EAAE,OAAO,YAAY,CAAC;KACzC;CACF;AAED,oBAAY,UAAU,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC"}