lavalink-client 2.1.4 → 2.1.5
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/dist/cjs/structures/Filters.d.ts +360 -360
- package/dist/cjs/structures/Filters.js +899 -899
- package/dist/cjs/structures/Player.d.ts +2 -2
- package/dist/cjs/structures/Player.js +12 -6
- package/dist/esm/structures/Filters.d.ts +360 -360
- package/dist/esm/structures/Filters.js +895 -895
- package/dist/esm/structures/Player.d.ts +2 -2
- package/dist/esm/structures/Player.js +12 -6
- package/dist/types/structures/Filters.d.ts +360 -360
- package/dist/types/structures/Player.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,360 +1,360 @@
|
|
|
1
|
-
import { Player } from "./Player";
|
|
2
|
-
import { FloatNumber, IntegerNumber } from "./Utils";
|
|
3
|
-
/**
|
|
4
|
-
* The FilterManager for each player
|
|
5
|
-
*/
|
|
6
|
-
export declare class FilterManager {
|
|
7
|
-
/** The Equalizer bands currently applied to the Lavalink Server */
|
|
8
|
-
equalizerBands: EQBand[];
|
|
9
|
-
/** Private Util for the instaFix Filters option */
|
|
10
|
-
filterUpdatedState: number;
|
|
11
|
-
/** All "Active" / "disabled" Player Filters */
|
|
12
|
-
filters: PlayerFilters;
|
|
13
|
-
/** The Filter Data sent to Lavalink, only if the filter is enabled (ofc.) */
|
|
14
|
-
data: FilterData;
|
|
15
|
-
/** The Player assigned to this Filter Manager */
|
|
16
|
-
player: Player;
|
|
17
|
-
/** The Constructor for the FilterManager */
|
|
18
|
-
constructor(player: Player);
|
|
19
|
-
/**
|
|
20
|
-
* Apply Player filters for lavalink filter sending data, if the filter is enabled / not
|
|
21
|
-
*/
|
|
22
|
-
applyPlayerFilters(): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Checks if the filters are correctly stated (active / not-active)
|
|
25
|
-
* @param oldFilterTimescale
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
checkFiltersState(oldFilterTimescale?: Partial<TimescaleFilter>): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Reset all Filters
|
|
31
|
-
*/
|
|
32
|
-
resetFilters(): Promise<PlayerFilters>;
|
|
33
|
-
/**
|
|
34
|
-
* Set the Filter Volume
|
|
35
|
-
* @param volume
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
setVolume(volume: number): Promise<boolean>;
|
|
39
|
-
/**
|
|
40
|
-
* Set the AudioOutput Filter
|
|
41
|
-
* @param type
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
setAudioOutput(type: AudioOutputs): Promise<AudioOutputs>;
|
|
45
|
-
/**
|
|
46
|
-
* Set custom filter.timescale#speed . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
47
|
-
* @param speed
|
|
48
|
-
* @returns
|
|
49
|
-
*/
|
|
50
|
-
setSpeed(speed?: number): Promise<boolean>;
|
|
51
|
-
/**
|
|
52
|
-
* Set custom filter.timescale#pitch . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
53
|
-
* @param speed
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
setPitch(pitch?: number): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* Set custom filter.timescale#rate . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
59
|
-
* @param speed
|
|
60
|
-
* @returns
|
|
61
|
-
*/
|
|
62
|
-
setRate(rate?: number): Promise<boolean>;
|
|
63
|
-
/**
|
|
64
|
-
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
|
|
65
|
-
* @param rotationHz
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
toggleRotation(rotationHz?: number): Promise<boolean>;
|
|
69
|
-
/**
|
|
70
|
-
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
|
|
71
|
-
* @param frequency
|
|
72
|
-
* @param depth
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
toggleVibrato(frequency?: number, depth?: number): Promise<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
|
|
78
|
-
* @param frequency
|
|
79
|
-
* @param depth
|
|
80
|
-
* @returns
|
|
81
|
-
*/
|
|
82
|
-
toggleTremolo(frequency?: number, depth?: number): Promise<boolean>;
|
|
83
|
-
/**
|
|
84
|
-
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
85
|
-
* @param smoothing
|
|
86
|
-
* @returns
|
|
87
|
-
*/
|
|
88
|
-
toggleLowPass(smoothing?: number): Promise<boolean>;
|
|
89
|
-
lavalinkLavaDspxPlugin: {
|
|
90
|
-
toggleLowPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<boolean>;
|
|
91
|
-
toggleHighPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<boolean>;
|
|
92
|
-
toggleNormalization: (maxAmplitude?: number, adaptive?: boolean) => Promise<boolean>;
|
|
93
|
-
toggleEcho: (decay?: number, echoLength?: number) => Promise<boolean>;
|
|
94
|
-
};
|
|
95
|
-
lavalinkFilterPlugin: {
|
|
96
|
-
/**
|
|
97
|
-
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
98
|
-
* @param delay
|
|
99
|
-
* @param decay
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
toggleEcho: (delay?: number, decay?: number) => Promise<boolean>;
|
|
103
|
-
/**
|
|
104
|
-
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
105
|
-
* @param delays
|
|
106
|
-
* @param gains
|
|
107
|
-
* @returns
|
|
108
|
-
*/
|
|
109
|
-
toggleReverb: (delays?: number[], gains?: number[]) => Promise<boolean>;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
|
|
113
|
-
* @param speed
|
|
114
|
-
* @param pitch
|
|
115
|
-
* @param rate
|
|
116
|
-
* @returns
|
|
117
|
-
*/
|
|
118
|
-
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
119
|
-
/**
|
|
120
|
-
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
|
|
121
|
-
* @param speed
|
|
122
|
-
* @param pitch
|
|
123
|
-
* @param rate
|
|
124
|
-
* @returns
|
|
125
|
-
*/
|
|
126
|
-
toggleVaporwave(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
127
|
-
/**
|
|
128
|
-
* Enable / Disables a Karaoke like Filter Effect
|
|
129
|
-
* @param level
|
|
130
|
-
* @param monoLevel
|
|
131
|
-
* @param filterBand
|
|
132
|
-
* @param filterWidth
|
|
133
|
-
* @returns
|
|
134
|
-
*/
|
|
135
|
-
toggleKaraoke(level?: number, monoLevel?: number, filterBand?: number, filterWidth?: number): Promise<boolean>;
|
|
136
|
-
/** Function to find out if currently there is a custom timescamle etc. filter applied */
|
|
137
|
-
isCustomFilterActive(): boolean;
|
|
138
|
-
/**
|
|
139
|
-
* Sets the players equalizer band on-top of the existing ones.
|
|
140
|
-
* @param bands
|
|
141
|
-
*/
|
|
142
|
-
setEQ(bands: EQBand | EQBand[]): Promise<this>;
|
|
143
|
-
/** Clears the equalizer bands. */
|
|
144
|
-
clearEQ(): Promise<this>;
|
|
145
|
-
}
|
|
146
|
-
/** The Audio Outputs type */
|
|
147
|
-
export type AudioOutputs = "mono" | "stereo" | "left" | "right";
|
|
148
|
-
/** The audio Outputs Data map declaration */
|
|
149
|
-
export declare const audioOutputsData: Record<AudioOutputs, ChannelMixFilter>;
|
|
150
|
-
/** The "active" / "disabled" Player Filters */
|
|
151
|
-
export interface PlayerFilters {
|
|
152
|
-
/** Sets nightcore to false, and vaporwave to false */
|
|
153
|
-
custom: boolean;
|
|
154
|
-
/** Sets custom to false, and vaporwave to false */
|
|
155
|
-
nightcore: boolean;
|
|
156
|
-
/** Sets custom to false, and nightcore to false */
|
|
157
|
-
vaporwave: boolean;
|
|
158
|
-
/** If rotation filter is enabled / not */
|
|
159
|
-
rotation: boolean;
|
|
160
|
-
/** if karaoke filter is enabled / not */
|
|
161
|
-
karaoke: boolean;
|
|
162
|
-
/** if tremolo filter is enabled / not */
|
|
163
|
-
tremolo: boolean;
|
|
164
|
-
/** if vibrato filter is enabled / not */
|
|
165
|
-
vibrato: boolean;
|
|
166
|
-
lowPass: boolean;
|
|
167
|
-
/** audio Output (default stereo, mono sounds the fullest and best for not-stereo tracks) */
|
|
168
|
-
audioOutput: AudioOutputs;
|
|
169
|
-
/** Lavalink Volume FILTER (not player Volume, think of it as a gain booster) */
|
|
170
|
-
volume: boolean;
|
|
171
|
-
/** Filters for the Lavalink Filter Plugin */
|
|
172
|
-
lavalinkFilterPlugin: {
|
|
173
|
-
/** if echo filter is enabled / not */
|
|
174
|
-
echo: boolean;
|
|
175
|
-
/** if reverb filter is enabled / not */
|
|
176
|
-
reverb: boolean;
|
|
177
|
-
};
|
|
178
|
-
lavalinkLavaDspxPlugin: {
|
|
179
|
-
/** if lowPass filter is enabled / not */
|
|
180
|
-
lowPass: boolean;
|
|
181
|
-
/** if highPass filter is enabled / not */
|
|
182
|
-
highPass: boolean;
|
|
183
|
-
/** if normalization filter is enabled / not */
|
|
184
|
-
normalization: boolean;
|
|
185
|
-
/** if echo filter is enabled / not */
|
|
186
|
-
echo: boolean;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* There are 15 bands (0-14) that can be changed.
|
|
191
|
-
* "gain" is the multiplier for the given band.
|
|
192
|
-
* The default value is 0.
|
|
193
|
-
* Valid values range from -0.25 to 1.0, where -0.25 means the given band is completely muted, and 0.25 means it is doubled.
|
|
194
|
-
* Modifying the gain could also change the volume of the output.
|
|
195
|
-
*/
|
|
196
|
-
export interface EQBand {
|
|
197
|
-
/** On what band position (0-14) it should work */
|
|
198
|
-
band: IntegerNumber | number;
|
|
199
|
-
/** The gain (-0.25 to 1.0) */
|
|
200
|
-
gain: FloatNumber | number;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Uses equalization to eliminate part of a band, usually targeting vocals.
|
|
204
|
-
*/
|
|
205
|
-
export interface KaraokeFilter {
|
|
206
|
-
/** The level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect) */
|
|
207
|
-
level?: number;
|
|
208
|
-
/** The mono level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect) */
|
|
209
|
-
monoLevel?: number;
|
|
210
|
-
/** The filter band (in Hz) */
|
|
211
|
-
filterBand?: number;
|
|
212
|
-
/** The filter width */
|
|
213
|
-
filterWidth?: number;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Changes the speed, pitch, and rate
|
|
217
|
-
*/
|
|
218
|
-
export interface TimescaleFilter {
|
|
219
|
-
/** The playback speed 0.0 ≤ x */
|
|
220
|
-
speed?: number;
|
|
221
|
-
/** The pitch 0.0 ≤ x */
|
|
222
|
-
pitch?: number;
|
|
223
|
-
/** The rate 0.0 ≤ x */
|
|
224
|
-
rate?: number;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Uses amplification to create a shuddering effect, where the volume quickly oscillates.
|
|
228
|
-
* Demo: https://en.wikipedia.org/wiki/File:Fuse_Electronics_Tremolo_MK-III_Quick_Demo.ogv
|
|
229
|
-
*/
|
|
230
|
-
export interface TremoloFilter {
|
|
231
|
-
/** The frequency 0.0 < x */
|
|
232
|
-
frequency?: number;
|
|
233
|
-
/** The tremolo depth 0.0 < x ≤ 1.0 */
|
|
234
|
-
depth?: number;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Similar to tremolo. While tremolo oscillates the volume, vibrato oscillates the pitch.
|
|
238
|
-
*/
|
|
239
|
-
export interface VibratoFilter {
|
|
240
|
-
/** The frequency 0.0 < x ≤ 14.0 */
|
|
241
|
-
frequency?: number;
|
|
242
|
-
/** The vibrato depth 0.0 < x ≤ 1.0 */
|
|
243
|
-
depth?: number;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Rotates the sound around the stereo channels/user headphones (aka Audio Panning).
|
|
247
|
-
* It can produce an effect similar to https://youtu.be/QB9EB8mTKcc (without the reverb).
|
|
248
|
-
*/
|
|
249
|
-
export interface RotationFilter {
|
|
250
|
-
/** The frequency of the audio rotating around the listener in Hz. 0.2 is similar to the example video above */
|
|
251
|
-
rotationHz?: number;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Distortion effect. It can generate some pretty unique audio effects.
|
|
255
|
-
*/
|
|
256
|
-
export interface DistortionFilter {
|
|
257
|
-
sinOffset?: number;
|
|
258
|
-
sinScale?: number;
|
|
259
|
-
cosOffset?: number;
|
|
260
|
-
cosScale?: number;
|
|
261
|
-
tanOffset?: number;
|
|
262
|
-
tanScale?: number;
|
|
263
|
-
offset?: number;
|
|
264
|
-
scale?: number;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Mixes both channels (left and right), with a configurable factor on how much each channel affects the other.
|
|
268
|
-
* With the defaults, both channels are kept independent of each other.
|
|
269
|
-
* Setting all factors to 0.5 means both channels get the same audio.
|
|
270
|
-
*/
|
|
271
|
-
export interface ChannelMixFilter {
|
|
272
|
-
/** The left to left channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
273
|
-
leftToLeft?: number;
|
|
274
|
-
/** The left to right channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
275
|
-
leftToRight?: number;
|
|
276
|
-
/** The right to left channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
277
|
-
rightToLeft?: number;
|
|
278
|
-
/** The right to right channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
279
|
-
rightToRight?: number;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Higher frequencies get suppressed, while lower frequencies pass through this filter, thus the name low pass.
|
|
283
|
-
* Any smoothing values equal to or less than 1.0 will disable the filter.
|
|
284
|
-
*/
|
|
285
|
-
export interface LowPassFilter {
|
|
286
|
-
/** The smoothing factor (1.0 < x) */
|
|
287
|
-
smoothing?: number;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Filter Data stored in the Client and partially sent to Lavalink
|
|
291
|
-
*/
|
|
292
|
-
export interface FilterData {
|
|
293
|
-
volume?: number;
|
|
294
|
-
karaoke?: KaraokeFilter;
|
|
295
|
-
timescale?: TimescaleFilter;
|
|
296
|
-
tremolo?: TremoloFilter;
|
|
297
|
-
vibrato?: VibratoFilter;
|
|
298
|
-
rotation?: RotationFilter;
|
|
299
|
-
distortion?: DistortionFilter;
|
|
300
|
-
channelMix?: ChannelMixFilter;
|
|
301
|
-
lowPass?: LowPassFilter;
|
|
302
|
-
pluginFilters?: {
|
|
303
|
-
"lavalink-filter-plugin"?: {
|
|
304
|
-
"echo"?: {
|
|
305
|
-
delay?: number;
|
|
306
|
-
decay?: number;
|
|
307
|
-
};
|
|
308
|
-
"reverb"?: {
|
|
309
|
-
delays?: number[];
|
|
310
|
-
gains?: number[];
|
|
311
|
-
};
|
|
312
|
-
};
|
|
313
|
-
"high-pass"?: {
|
|
314
|
-
cutoffFrequency?: number;
|
|
315
|
-
boostFactor?: number;
|
|
316
|
-
};
|
|
317
|
-
"low-pass"?: {
|
|
318
|
-
cutoffFrequency?: number;
|
|
319
|
-
boostFactor?: number;
|
|
320
|
-
};
|
|
321
|
-
normalization?: {
|
|
322
|
-
maxAmplitude?: number;
|
|
323
|
-
adaptive?: boolean;
|
|
324
|
-
};
|
|
325
|
-
echo?: {
|
|
326
|
-
echoLength?: number;
|
|
327
|
-
decay?: number;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Actual Filter Data sent to Lavalink
|
|
333
|
-
*/
|
|
334
|
-
export interface LavalinkFilterData extends FilterData {
|
|
335
|
-
equalizer?: EQBand[];
|
|
336
|
-
}
|
|
337
|
-
export declare const EQList: {
|
|
338
|
-
/** A Bassboost Equalizer, so high it distorts the audio */
|
|
339
|
-
BassboostEarrape: EQBand[];
|
|
340
|
-
/** A High and decent Bassboost Equalizer */
|
|
341
|
-
BassboostHigh: EQBand[];
|
|
342
|
-
/** A decent Bassboost Equalizer */
|
|
343
|
-
BassboostMedium: EQBand[];
|
|
344
|
-
/** A slight Bassboost Equalizer */
|
|
345
|
-
BassboostLow: EQBand[];
|
|
346
|
-
/** Makes the Music slightly "better" */
|
|
347
|
-
BetterMusic: EQBand[];
|
|
348
|
-
/** Makes the Music sound like rock music / sound rock music better */
|
|
349
|
-
Rock: EQBand[];
|
|
350
|
-
/** Makes the Music sound like Classic music / sound Classic music better */
|
|
351
|
-
Classic: EQBand[];
|
|
352
|
-
/** Makes the Music sound like Pop music / sound Pop music better */
|
|
353
|
-
Pop: EQBand[];
|
|
354
|
-
/** Makes the Music sound like Electronic music / sound Electronic music better */
|
|
355
|
-
Electronic: EQBand[];
|
|
356
|
-
/** Boosts all Bands slightly for louder and fuller sound */
|
|
357
|
-
FullSound: EQBand[];
|
|
358
|
-
/** Boosts basses + lower highs for a pro gaming sound */
|
|
359
|
-
Gaming: EQBand[];
|
|
360
|
-
};
|
|
1
|
+
import { Player } from "./Player";
|
|
2
|
+
import { FloatNumber, IntegerNumber } from "./Utils";
|
|
3
|
+
/**
|
|
4
|
+
* The FilterManager for each player
|
|
5
|
+
*/
|
|
6
|
+
export declare class FilterManager {
|
|
7
|
+
/** The Equalizer bands currently applied to the Lavalink Server */
|
|
8
|
+
equalizerBands: EQBand[];
|
|
9
|
+
/** Private Util for the instaFix Filters option */
|
|
10
|
+
filterUpdatedState: number;
|
|
11
|
+
/** All "Active" / "disabled" Player Filters */
|
|
12
|
+
filters: PlayerFilters;
|
|
13
|
+
/** The Filter Data sent to Lavalink, only if the filter is enabled (ofc.) */
|
|
14
|
+
data: FilterData;
|
|
15
|
+
/** The Player assigned to this Filter Manager */
|
|
16
|
+
player: Player;
|
|
17
|
+
/** The Constructor for the FilterManager */
|
|
18
|
+
constructor(player: Player);
|
|
19
|
+
/**
|
|
20
|
+
* Apply Player filters for lavalink filter sending data, if the filter is enabled / not
|
|
21
|
+
*/
|
|
22
|
+
applyPlayerFilters(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the filters are correctly stated (active / not-active)
|
|
25
|
+
* @param oldFilterTimescale
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
checkFiltersState(oldFilterTimescale?: Partial<TimescaleFilter>): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Reset all Filters
|
|
31
|
+
*/
|
|
32
|
+
resetFilters(): Promise<PlayerFilters>;
|
|
33
|
+
/**
|
|
34
|
+
* Set the Filter Volume
|
|
35
|
+
* @param volume
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
setVolume(volume: number): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Set the AudioOutput Filter
|
|
41
|
+
* @param type
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
setAudioOutput(type: AudioOutputs): Promise<AudioOutputs>;
|
|
45
|
+
/**
|
|
46
|
+
* Set custom filter.timescale#speed . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
47
|
+
* @param speed
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
setSpeed(speed?: number): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Set custom filter.timescale#pitch . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
53
|
+
* @param speed
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
setPitch(pitch?: number): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Set custom filter.timescale#rate . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
59
|
+
* @param speed
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
setRate(rate?: number): Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
|
|
65
|
+
* @param rotationHz
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
toggleRotation(rotationHz?: number): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
|
|
71
|
+
* @param frequency
|
|
72
|
+
* @param depth
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
toggleVibrato(frequency?: number, depth?: number): Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
|
|
78
|
+
* @param frequency
|
|
79
|
+
* @param depth
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
toggleTremolo(frequency?: number, depth?: number): Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
85
|
+
* @param smoothing
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
toggleLowPass(smoothing?: number): Promise<boolean>;
|
|
89
|
+
lavalinkLavaDspxPlugin: {
|
|
90
|
+
toggleLowPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<boolean>;
|
|
91
|
+
toggleHighPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<boolean>;
|
|
92
|
+
toggleNormalization: (maxAmplitude?: number, adaptive?: boolean) => Promise<boolean>;
|
|
93
|
+
toggleEcho: (decay?: number, echoLength?: number) => Promise<boolean>;
|
|
94
|
+
};
|
|
95
|
+
lavalinkFilterPlugin: {
|
|
96
|
+
/**
|
|
97
|
+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
98
|
+
* @param delay
|
|
99
|
+
* @param decay
|
|
100
|
+
* @returns
|
|
101
|
+
*/
|
|
102
|
+
toggleEcho: (delay?: number, decay?: number) => Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
105
|
+
* @param delays
|
|
106
|
+
* @param gains
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
toggleReverb: (delays?: number[], gains?: number[]) => Promise<boolean>;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
|
|
113
|
+
* @param speed
|
|
114
|
+
* @param pitch
|
|
115
|
+
* @param rate
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
118
|
+
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
|
|
121
|
+
* @param speed
|
|
122
|
+
* @param pitch
|
|
123
|
+
* @param rate
|
|
124
|
+
* @returns
|
|
125
|
+
*/
|
|
126
|
+
toggleVaporwave(speed?: number, pitch?: number, rate?: number): Promise<boolean>;
|
|
127
|
+
/**
|
|
128
|
+
* Enable / Disables a Karaoke like Filter Effect
|
|
129
|
+
* @param level
|
|
130
|
+
* @param monoLevel
|
|
131
|
+
* @param filterBand
|
|
132
|
+
* @param filterWidth
|
|
133
|
+
* @returns
|
|
134
|
+
*/
|
|
135
|
+
toggleKaraoke(level?: number, monoLevel?: number, filterBand?: number, filterWidth?: number): Promise<boolean>;
|
|
136
|
+
/** Function to find out if currently there is a custom timescamle etc. filter applied */
|
|
137
|
+
isCustomFilterActive(): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Sets the players equalizer band on-top of the existing ones.
|
|
140
|
+
* @param bands
|
|
141
|
+
*/
|
|
142
|
+
setEQ(bands: EQBand | EQBand[]): Promise<this>;
|
|
143
|
+
/** Clears the equalizer bands. */
|
|
144
|
+
clearEQ(): Promise<this>;
|
|
145
|
+
}
|
|
146
|
+
/** The Audio Outputs type */
|
|
147
|
+
export type AudioOutputs = "mono" | "stereo" | "left" | "right";
|
|
148
|
+
/** The audio Outputs Data map declaration */
|
|
149
|
+
export declare const audioOutputsData: Record<AudioOutputs, ChannelMixFilter>;
|
|
150
|
+
/** The "active" / "disabled" Player Filters */
|
|
151
|
+
export interface PlayerFilters {
|
|
152
|
+
/** Sets nightcore to false, and vaporwave to false */
|
|
153
|
+
custom: boolean;
|
|
154
|
+
/** Sets custom to false, and vaporwave to false */
|
|
155
|
+
nightcore: boolean;
|
|
156
|
+
/** Sets custom to false, and nightcore to false */
|
|
157
|
+
vaporwave: boolean;
|
|
158
|
+
/** If rotation filter is enabled / not */
|
|
159
|
+
rotation: boolean;
|
|
160
|
+
/** if karaoke filter is enabled / not */
|
|
161
|
+
karaoke: boolean;
|
|
162
|
+
/** if tremolo filter is enabled / not */
|
|
163
|
+
tremolo: boolean;
|
|
164
|
+
/** if vibrato filter is enabled / not */
|
|
165
|
+
vibrato: boolean;
|
|
166
|
+
lowPass: boolean;
|
|
167
|
+
/** audio Output (default stereo, mono sounds the fullest and best for not-stereo tracks) */
|
|
168
|
+
audioOutput: AudioOutputs;
|
|
169
|
+
/** Lavalink Volume FILTER (not player Volume, think of it as a gain booster) */
|
|
170
|
+
volume: boolean;
|
|
171
|
+
/** Filters for the Lavalink Filter Plugin */
|
|
172
|
+
lavalinkFilterPlugin: {
|
|
173
|
+
/** if echo filter is enabled / not */
|
|
174
|
+
echo: boolean;
|
|
175
|
+
/** if reverb filter is enabled / not */
|
|
176
|
+
reverb: boolean;
|
|
177
|
+
};
|
|
178
|
+
lavalinkLavaDspxPlugin: {
|
|
179
|
+
/** if lowPass filter is enabled / not */
|
|
180
|
+
lowPass: boolean;
|
|
181
|
+
/** if highPass filter is enabled / not */
|
|
182
|
+
highPass: boolean;
|
|
183
|
+
/** if normalization filter is enabled / not */
|
|
184
|
+
normalization: boolean;
|
|
185
|
+
/** if echo filter is enabled / not */
|
|
186
|
+
echo: boolean;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* There are 15 bands (0-14) that can be changed.
|
|
191
|
+
* "gain" is the multiplier for the given band.
|
|
192
|
+
* The default value is 0.
|
|
193
|
+
* Valid values range from -0.25 to 1.0, where -0.25 means the given band is completely muted, and 0.25 means it is doubled.
|
|
194
|
+
* Modifying the gain could also change the volume of the output.
|
|
195
|
+
*/
|
|
196
|
+
export interface EQBand {
|
|
197
|
+
/** On what band position (0-14) it should work */
|
|
198
|
+
band: IntegerNumber | number;
|
|
199
|
+
/** The gain (-0.25 to 1.0) */
|
|
200
|
+
gain: FloatNumber | number;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Uses equalization to eliminate part of a band, usually targeting vocals.
|
|
204
|
+
*/
|
|
205
|
+
export interface KaraokeFilter {
|
|
206
|
+
/** The level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect) */
|
|
207
|
+
level?: number;
|
|
208
|
+
/** The mono level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect) */
|
|
209
|
+
monoLevel?: number;
|
|
210
|
+
/** The filter band (in Hz) */
|
|
211
|
+
filterBand?: number;
|
|
212
|
+
/** The filter width */
|
|
213
|
+
filterWidth?: number;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Changes the speed, pitch, and rate
|
|
217
|
+
*/
|
|
218
|
+
export interface TimescaleFilter {
|
|
219
|
+
/** The playback speed 0.0 ≤ x */
|
|
220
|
+
speed?: number;
|
|
221
|
+
/** The pitch 0.0 ≤ x */
|
|
222
|
+
pitch?: number;
|
|
223
|
+
/** The rate 0.0 ≤ x */
|
|
224
|
+
rate?: number;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Uses amplification to create a shuddering effect, where the volume quickly oscillates.
|
|
228
|
+
* Demo: https://en.wikipedia.org/wiki/File:Fuse_Electronics_Tremolo_MK-III_Quick_Demo.ogv
|
|
229
|
+
*/
|
|
230
|
+
export interface TremoloFilter {
|
|
231
|
+
/** The frequency 0.0 < x */
|
|
232
|
+
frequency?: number;
|
|
233
|
+
/** The tremolo depth 0.0 < x ≤ 1.0 */
|
|
234
|
+
depth?: number;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Similar to tremolo. While tremolo oscillates the volume, vibrato oscillates the pitch.
|
|
238
|
+
*/
|
|
239
|
+
export interface VibratoFilter {
|
|
240
|
+
/** The frequency 0.0 < x ≤ 14.0 */
|
|
241
|
+
frequency?: number;
|
|
242
|
+
/** The vibrato depth 0.0 < x ≤ 1.0 */
|
|
243
|
+
depth?: number;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Rotates the sound around the stereo channels/user headphones (aka Audio Panning).
|
|
247
|
+
* It can produce an effect similar to https://youtu.be/QB9EB8mTKcc (without the reverb).
|
|
248
|
+
*/
|
|
249
|
+
export interface RotationFilter {
|
|
250
|
+
/** The frequency of the audio rotating around the listener in Hz. 0.2 is similar to the example video above */
|
|
251
|
+
rotationHz?: number;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Distortion effect. It can generate some pretty unique audio effects.
|
|
255
|
+
*/
|
|
256
|
+
export interface DistortionFilter {
|
|
257
|
+
sinOffset?: number;
|
|
258
|
+
sinScale?: number;
|
|
259
|
+
cosOffset?: number;
|
|
260
|
+
cosScale?: number;
|
|
261
|
+
tanOffset?: number;
|
|
262
|
+
tanScale?: number;
|
|
263
|
+
offset?: number;
|
|
264
|
+
scale?: number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Mixes both channels (left and right), with a configurable factor on how much each channel affects the other.
|
|
268
|
+
* With the defaults, both channels are kept independent of each other.
|
|
269
|
+
* Setting all factors to 0.5 means both channels get the same audio.
|
|
270
|
+
*/
|
|
271
|
+
export interface ChannelMixFilter {
|
|
272
|
+
/** The left to left channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
273
|
+
leftToLeft?: number;
|
|
274
|
+
/** The left to right channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
275
|
+
leftToRight?: number;
|
|
276
|
+
/** The right to left channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
277
|
+
rightToLeft?: number;
|
|
278
|
+
/** The right to right channel mix factor (0.0 ≤ x ≤ 1.0) */
|
|
279
|
+
rightToRight?: number;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Higher frequencies get suppressed, while lower frequencies pass through this filter, thus the name low pass.
|
|
283
|
+
* Any smoothing values equal to or less than 1.0 will disable the filter.
|
|
284
|
+
*/
|
|
285
|
+
export interface LowPassFilter {
|
|
286
|
+
/** The smoothing factor (1.0 < x) */
|
|
287
|
+
smoothing?: number;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Filter Data stored in the Client and partially sent to Lavalink
|
|
291
|
+
*/
|
|
292
|
+
export interface FilterData {
|
|
293
|
+
volume?: number;
|
|
294
|
+
karaoke?: KaraokeFilter;
|
|
295
|
+
timescale?: TimescaleFilter;
|
|
296
|
+
tremolo?: TremoloFilter;
|
|
297
|
+
vibrato?: VibratoFilter;
|
|
298
|
+
rotation?: RotationFilter;
|
|
299
|
+
distortion?: DistortionFilter;
|
|
300
|
+
channelMix?: ChannelMixFilter;
|
|
301
|
+
lowPass?: LowPassFilter;
|
|
302
|
+
pluginFilters?: {
|
|
303
|
+
"lavalink-filter-plugin"?: {
|
|
304
|
+
"echo"?: {
|
|
305
|
+
delay?: number;
|
|
306
|
+
decay?: number;
|
|
307
|
+
};
|
|
308
|
+
"reverb"?: {
|
|
309
|
+
delays?: number[];
|
|
310
|
+
gains?: number[];
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
"high-pass"?: {
|
|
314
|
+
cutoffFrequency?: number;
|
|
315
|
+
boostFactor?: number;
|
|
316
|
+
};
|
|
317
|
+
"low-pass"?: {
|
|
318
|
+
cutoffFrequency?: number;
|
|
319
|
+
boostFactor?: number;
|
|
320
|
+
};
|
|
321
|
+
normalization?: {
|
|
322
|
+
maxAmplitude?: number;
|
|
323
|
+
adaptive?: boolean;
|
|
324
|
+
};
|
|
325
|
+
echo?: {
|
|
326
|
+
echoLength?: number;
|
|
327
|
+
decay?: number;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Actual Filter Data sent to Lavalink
|
|
333
|
+
*/
|
|
334
|
+
export interface LavalinkFilterData extends FilterData {
|
|
335
|
+
equalizer?: EQBand[];
|
|
336
|
+
}
|
|
337
|
+
export declare const EQList: {
|
|
338
|
+
/** A Bassboost Equalizer, so high it distorts the audio */
|
|
339
|
+
BassboostEarrape: EQBand[];
|
|
340
|
+
/** A High and decent Bassboost Equalizer */
|
|
341
|
+
BassboostHigh: EQBand[];
|
|
342
|
+
/** A decent Bassboost Equalizer */
|
|
343
|
+
BassboostMedium: EQBand[];
|
|
344
|
+
/** A slight Bassboost Equalizer */
|
|
345
|
+
BassboostLow: EQBand[];
|
|
346
|
+
/** Makes the Music slightly "better" */
|
|
347
|
+
BetterMusic: EQBand[];
|
|
348
|
+
/** Makes the Music sound like rock music / sound rock music better */
|
|
349
|
+
Rock: EQBand[];
|
|
350
|
+
/** Makes the Music sound like Classic music / sound Classic music better */
|
|
351
|
+
Classic: EQBand[];
|
|
352
|
+
/** Makes the Music sound like Pop music / sound Pop music better */
|
|
353
|
+
Pop: EQBand[];
|
|
354
|
+
/** Makes the Music sound like Electronic music / sound Electronic music better */
|
|
355
|
+
Electronic: EQBand[];
|
|
356
|
+
/** Boosts all Bands slightly for louder and fuller sound */
|
|
357
|
+
FullSound: EQBand[];
|
|
358
|
+
/** Boosts basses + lower highs for a pro gaming sound */
|
|
359
|
+
Gaming: EQBand[];
|
|
360
|
+
};
|