lavalink-client 2.5.7 → 2.5.8

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 (98) hide show
  1. package/README.md +9 -2
  2. package/dist/index.d.mts +3036 -0
  3. package/dist/index.d.ts +3036 -0
  4. package/dist/index.js +4965 -0
  5. package/dist/index.mjs +4904 -0
  6. package/package.json +21 -24
  7. package/dist/cjs/index.d.ts +0 -16
  8. package/dist/cjs/index.js +0 -19
  9. package/dist/cjs/package.json +0 -3
  10. package/dist/cjs/structures/Constants.d.ts +0 -90
  11. package/dist/cjs/structures/Constants.js +0 -296
  12. package/dist/cjs/structures/CustomSearches/BandCampSearch.d.ts +0 -3
  13. package/dist/cjs/structures/CustomSearches/BandCampSearch.js +0 -39
  14. package/dist/cjs/structures/Filters.d.ts +0 -169
  15. package/dist/cjs/structures/Filters.js +0 -700
  16. package/dist/cjs/structures/LavalinkManager.d.ts +0 -232
  17. package/dist/cjs/structures/LavalinkManager.js +0 -621
  18. package/dist/cjs/structures/LavalinkManagerStatics.d.ts +0 -15
  19. package/dist/cjs/structures/LavalinkManagerStatics.js +0 -149
  20. package/dist/cjs/structures/Node.d.ts +0 -523
  21. package/dist/cjs/structures/Node.js +0 -1605
  22. package/dist/cjs/structures/NodeManager.d.ts +0 -100
  23. package/dist/cjs/structures/NodeManager.js +0 -224
  24. package/dist/cjs/structures/Player.d.ts +0 -223
  25. package/dist/cjs/structures/Player.js +0 -807
  26. package/dist/cjs/structures/Queue.d.ts +0 -186
  27. package/dist/cjs/structures/Queue.js +0 -390
  28. package/dist/cjs/structures/Types/Filters.d.ts +0 -190
  29. package/dist/cjs/structures/Types/Filters.js +0 -2
  30. package/dist/cjs/structures/Types/Manager.d.ts +0 -271
  31. package/dist/cjs/structures/Types/Manager.js +0 -2
  32. package/dist/cjs/structures/Types/Node.d.ts +0 -238
  33. package/dist/cjs/structures/Types/Node.js +0 -2
  34. package/dist/cjs/structures/Types/Player.d.ts +0 -114
  35. package/dist/cjs/structures/Types/Player.js +0 -2
  36. package/dist/cjs/structures/Types/Queue.d.ts +0 -35
  37. package/dist/cjs/structures/Types/Queue.js +0 -2
  38. package/dist/cjs/structures/Types/Track.d.ts +0 -134
  39. package/dist/cjs/structures/Types/Track.js +0 -2
  40. package/dist/cjs/structures/Types/Utils.d.ts +0 -443
  41. package/dist/cjs/structures/Types/Utils.js +0 -2
  42. package/dist/cjs/structures/Utils.d.ts +0 -116
  43. package/dist/cjs/structures/Utils.js +0 -567
  44. package/dist/esm/index.d.ts +0 -16
  45. package/dist/esm/index.js +0 -16
  46. package/dist/esm/package.json +0 -3
  47. package/dist/esm/structures/Constants.d.ts +0 -90
  48. package/dist/esm/structures/Constants.js +0 -293
  49. package/dist/esm/structures/CustomSearches/BandCampSearch.d.ts +0 -3
  50. package/dist/esm/structures/CustomSearches/BandCampSearch.js +0 -35
  51. package/dist/esm/structures/Filters.d.ts +0 -169
  52. package/dist/esm/structures/Filters.js +0 -696
  53. package/dist/esm/structures/LavalinkManager.d.ts +0 -232
  54. package/dist/esm/structures/LavalinkManager.js +0 -617
  55. package/dist/esm/structures/LavalinkManagerStatics.d.ts +0 -15
  56. package/dist/esm/structures/LavalinkManagerStatics.js +0 -146
  57. package/dist/esm/structures/Node.d.ts +0 -523
  58. package/dist/esm/structures/Node.js +0 -1600
  59. package/dist/esm/structures/NodeManager.d.ts +0 -100
  60. package/dist/esm/structures/NodeManager.js +0 -220
  61. package/dist/esm/structures/Player.d.ts +0 -223
  62. package/dist/esm/structures/Player.js +0 -803
  63. package/dist/esm/structures/Queue.d.ts +0 -186
  64. package/dist/esm/structures/Queue.js +0 -384
  65. package/dist/esm/structures/Types/Filters.d.ts +0 -190
  66. package/dist/esm/structures/Types/Filters.js +0 -1
  67. package/dist/esm/structures/Types/Manager.d.ts +0 -271
  68. package/dist/esm/structures/Types/Manager.js +0 -1
  69. package/dist/esm/structures/Types/Node.d.ts +0 -238
  70. package/dist/esm/structures/Types/Node.js +0 -1
  71. package/dist/esm/structures/Types/Player.d.ts +0 -114
  72. package/dist/esm/structures/Types/Player.js +0 -1
  73. package/dist/esm/structures/Types/Queue.d.ts +0 -35
  74. package/dist/esm/structures/Types/Queue.js +0 -1
  75. package/dist/esm/structures/Types/Track.d.ts +0 -134
  76. package/dist/esm/structures/Types/Track.js +0 -1
  77. package/dist/esm/structures/Types/Utils.d.ts +0 -443
  78. package/dist/esm/structures/Types/Utils.js +0 -1
  79. package/dist/esm/structures/Utils.d.ts +0 -116
  80. package/dist/esm/structures/Utils.js +0 -559
  81. package/dist/types/index.d.ts +0 -16
  82. package/dist/types/structures/Constants.d.ts +0 -90
  83. package/dist/types/structures/CustomSearches/BandCampSearch.d.ts +0 -3
  84. package/dist/types/structures/Filters.d.ts +0 -169
  85. package/dist/types/structures/LavalinkManager.d.ts +0 -232
  86. package/dist/types/structures/LavalinkManagerStatics.d.ts +0 -15
  87. package/dist/types/structures/Node.d.ts +0 -523
  88. package/dist/types/structures/NodeManager.d.ts +0 -100
  89. package/dist/types/structures/Player.d.ts +0 -223
  90. package/dist/types/structures/Queue.d.ts +0 -186
  91. package/dist/types/structures/Types/Filters.d.ts +0 -190
  92. package/dist/types/structures/Types/Manager.d.ts +0 -271
  93. package/dist/types/structures/Types/Node.d.ts +0 -238
  94. package/dist/types/structures/Types/Player.d.ts +0 -114
  95. package/dist/types/structures/Types/Queue.d.ts +0 -35
  96. package/dist/types/structures/Types/Track.d.ts +0 -134
  97. package/dist/types/structures/Types/Utils.d.ts +0 -443
  98. package/dist/types/structures/Utils.d.ts +0 -116
@@ -1,223 +0,0 @@
1
- import { FilterManager } from "./Filters";
2
- import { Queue } from "./Queue";
3
- import type { DestroyReasons } from "./Constants";
4
- import type { Track } from "./Types/Track";
5
- import type { LavalinkNode } from "./Node";
6
- import type { SponsorBlockSegment } from "./Types/Node";
7
- import type { PlayerJson, PlayerOptions, PlayOptions, RepeatMode } from "./Types/Player";
8
- import type { LavalinkManager } from "./LavalinkManager";
9
- import type { LavalinkPlayerVoiceOptions, LavaSearchQuery, SearchQuery } from "./Types/Utils";
10
- export declare class Player {
11
- /** Filter Manager per player */
12
- filterManager: FilterManager;
13
- /** circular reference to the lavalink Manager from the Player for easier use */
14
- LavalinkManager: LavalinkManager;
15
- /** Player options currently used, mutation doesn't affect player's state */
16
- options: PlayerOptions;
17
- /** The lavalink node assigned the the player, don't change it manually */
18
- node: LavalinkNode;
19
- /** The queue from the player */
20
- queue: Queue;
21
- /** The Guild Id of the Player */
22
- guildId: string;
23
- /** The Voice Channel Id of the Player */
24
- voiceChannelId: string | null;
25
- /** The Text Channel Id of the Player */
26
- textChannelId: string | null;
27
- /** States if the Bot is supposed to be outputting audio */
28
- playing: boolean;
29
- /** States if the Bot is paused or not */
30
- paused: boolean;
31
- /** Repeat Mode of the Player */
32
- repeatMode: RepeatMode;
33
- /** Player's ping */
34
- ping: {
35
- lavalink: number;
36
- ws: number;
37
- };
38
- /** The Display Volume */
39
- volume: number;
40
- /** The Volume Lavalink actually is outputting */
41
- lavalinkVolume: number;
42
- /** The current Positin of the player (Calculated) */
43
- get position(): number;
44
- /** The timestamp when the last position change update happened */
45
- lastPositionChange: number;
46
- /** The current Positin of the player (from Lavalink) */
47
- lastPosition: number;
48
- lastSavedPosition: number;
49
- /** When the player was created [Timestamp in Ms] (from lavalink) */
50
- createdTimeStamp: number;
51
- /** The Player Connection's State (from Lavalink) */
52
- connected: boolean | undefined;
53
- /** Voice Server Data (from Lavalink) */
54
- voice: LavalinkPlayerVoiceOptions;
55
- voiceState: {
56
- selfDeaf: boolean;
57
- selfMute: boolean;
58
- serverDeaf: boolean;
59
- serverMute: boolean;
60
- suppress: boolean;
61
- };
62
- /** Custom data for the player */
63
- private readonly data;
64
- /**
65
- * Create a new Player
66
- * @param options
67
- * @param LavalinkManager
68
- */
69
- constructor(options: PlayerOptions, LavalinkManager: LavalinkManager, dontEmitPlayerCreateEvent?: boolean);
70
- /**
71
- * Set custom data.
72
- * @param key
73
- * @param value
74
- */
75
- set(key: string, value: unknown): this;
76
- /**
77
- * Get custom data.
78
- * @param key
79
- */
80
- get<T>(key: string): T;
81
- /**
82
- * CLears all the custom data.
83
- */
84
- clearData(): this;
85
- /**
86
- * Get all custom Data
87
- */
88
- getAllData(): Record<string, unknown>;
89
- /**
90
- * Play the next track from the queue / a specific track, with playoptions for Lavalink
91
- * @param options
92
- */
93
- play(options?: Partial<PlayOptions>): any;
94
- /**
95
- * Set the Volume for the Player
96
- * @param volume The Volume in percent
97
- * @param ignoreVolumeDecrementer If it should ignore the volumedecrementer option
98
- */
99
- setVolume(volume: number, ignoreVolumeDecrementer?: boolean): Promise<this>;
100
- /**
101
- * Search for a track
102
- * @param query The query to search for
103
- * @param requestUser The user that requested the track
104
- * @param throwOnEmpty If an error should be thrown if no track is found
105
- * @returns The search result
106
- */
107
- lavaSearch(query: LavaSearchQuery, requestUser: unknown, throwOnEmpty?: boolean): Promise<import("./Types/Utils").LavaSearchResponse | import("./Types/Utils").SearchResult>;
108
- /**
109
- * Set the SponsorBlock
110
- * @param segments The segments to set
111
- */
112
- setSponsorBlock(segments?: SponsorBlockSegment[]): Promise<void>;
113
- /**
114
- * Get the SponsorBlock
115
- */
116
- getSponsorBlock(): Promise<SponsorBlockSegment[]>;
117
- /**
118
- * Delete the SponsorBlock
119
- */
120
- deleteSponsorBlock(): Promise<void>;
121
- /**
122
- *
123
- * @param query Query for your data
124
- * @param requestUser
125
- */
126
- search(query: SearchQuery, requestUser: unknown, throwOnEmpty?: boolean): Promise<import("./Types/Utils").UnresolvedSearchResult | import("./Types/Utils").SearchResult>;
127
- /**
128
- * Pause the player
129
- */
130
- pause(): Promise<this>;
131
- /**
132
- * Resume the Player
133
- */
134
- resume(): Promise<this>;
135
- /**
136
- * Seek to a specific Position
137
- * @param position
138
- */
139
- seek(position: number): Promise<this>;
140
- /**
141
- * Set the Repeatmode of the Player
142
- * @param repeatMode
143
- */
144
- setRepeatMode(repeatMode: RepeatMode): Promise<this>;
145
- /**
146
- * Skip the current song, or a specific amount of songs
147
- * @param amount provide the index of the next track to skip to
148
- */
149
- skip(skipTo?: number, throwError?: boolean): Promise<this>;
150
- /**
151
- * Clears the queue and stops playing. Does not destroy the Player and not leave the channel
152
- * @returns
153
- */
154
- stopPlaying(clearQueue?: boolean, executeAutoplay?: boolean): Promise<this>;
155
- /**
156
- * Connects the Player to the Voice Channel
157
- * @returns
158
- */
159
- connect(): Promise<this>;
160
- changeVoiceState(data: {
161
- voiceChannelId?: string;
162
- selfDeaf?: boolean;
163
- selfMute?: boolean;
164
- }): Promise<this>;
165
- /**
166
- * Disconnects the Player from the Voice Channel, but keeps the player in the cache
167
- * @param force If false it throws an error, if player thinks it's already disconnected
168
- * @returns
169
- */
170
- disconnect(force?: boolean): Promise<this>;
171
- /**
172
- * Destroy the player and disconnect from the voice channel
173
- */
174
- destroy(reason?: DestroyReasons | string, disconnect?: boolean): Promise<this>;
175
- /**
176
- * Get the current lyrics of the track currently playing on the guild
177
- * @param guildId The guild id to get the current lyrics for
178
- * @param skipTrackSource If true, it will not try to get the lyrics from the track source
179
- * @returns The current lyrics
180
- * @example
181
- * ```ts
182
- * const lyrics = await player.getCurrentLyrics();
183
- * ```
184
- */
185
- getCurrentLyrics(skipTrackSource?: boolean): Promise<import("./Types/Node").LyricsResult>;
186
- /**
187
- * Get the lyrics of a specific track
188
- * @param track The track to get the lyrics for
189
- * @param skipTrackSource If true, it will not try to get the lyrics from the track source
190
- * @returns The lyrics of the track
191
- * @example
192
- * ```ts
193
- * const lyrics = await player.getLyrics(player.queue.tracks[0], true);
194
- * ```
195
- */
196
- getLyrics(track: Track, skipTrackSource?: boolean): Promise<import("./Types/Node").LyricsResult>;
197
- /**
198
- * Subscribe to the lyrics event on a specific guild to active live lyrics events
199
- * @returns The unsubscribe function
200
- * @example
201
- * ```ts
202
- * const lyrics = await player.subscribeLyrics();
203
- * ```
204
- */
205
- subscribeLyrics(): Promise<unknown>;
206
- /**
207
- * Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
208
- * @returns The unsubscribe function
209
- * @example
210
- * ```ts
211
- * const lyrics = await player.unsubscribeLyrics();
212
- * ```
213
- */
214
- unsubscribeLyrics(): Promise<void>;
215
- /**
216
- * Move the player on a different Audio-Node
217
- * @param newNode New Node / New Node Id
218
- * @param checkSources If it should check if the sources are supported by the new node
219
- */
220
- changeNode(newNode: LavalinkNode | string, checkSources?: boolean): Promise<string>;
221
- /** Converts the Player including Queue to a Json state */
222
- toJSON(): PlayerJson;
223
- }
@@ -1,186 +0,0 @@
1
- import type { Track, UnresolvedTrack } from "./Types/Track";
2
- import type { ManagerQueueOptions, QueueStoreManager, StoredQueue } from "./Types/Queue";
3
- export declare class QueueSaver {
4
- /**
5
- * The queue store manager
6
- */
7
- private _;
8
- /**
9
- * The options for the queue saver
10
- */
11
- options: {
12
- maxPreviousTracks: number;
13
- };
14
- constructor(options: ManagerQueueOptions);
15
- /**
16
- * Get the queue for a guild
17
- * @param guildId The guild ID
18
- * @returns The queue for the guild
19
- */
20
- get(guildId: string): Promise<Partial<StoredQueue>>;
21
- /**
22
- * Delete the queue for a guild
23
- * @param guildId The guild ID
24
- * @returns The queue for the guild
25
- */
26
- delete(guildId: string): Promise<boolean | void>;
27
- /**
28
- * Set the queue for a guild
29
- * @param guildId The guild ID
30
- * @param valueToStringify The queue to set
31
- * @returns The queue for the guild
32
- */
33
- set(guildId: string, valueToStringify: StoredQueue): Promise<boolean | void>;
34
- /**
35
- * Sync the queue for a guild
36
- * @param guildId The guild ID
37
- * @returns The queue for the guild
38
- */
39
- sync(guildId: string): Promise<Partial<StoredQueue>>;
40
- }
41
- export declare class DefaultQueueStore implements QueueStoreManager {
42
- private data;
43
- constructor();
44
- /**
45
- * Get the queue for a guild
46
- * @param guildId The guild ID
47
- * @returns The queue for the guild
48
- */
49
- get(guildId: string): StoredQueue;
50
- /**
51
- * Set the queue for a guild
52
- * @param guildId The guild ID
53
- * @param valueToStringify The queue to set
54
- * @returns The queue for the guild
55
- */
56
- set(guildId: string, valueToStringify: any): boolean;
57
- /**
58
- * Delete the queue for a guild
59
- * @param guildId The guild ID
60
- * @returns The queue for the guild
61
- */
62
- delete(guildId: string): boolean;
63
- /**
64
- * Stringify the queue for a guild
65
- * @param value The queue to stringify
66
- * @returns The stringified queue
67
- */
68
- stringify(value: StoredQueue | string): StoredQueue | string;
69
- /**
70
- * Parse the queue for a guild
71
- * @param value The queue to parse
72
- * @returns The parsed queue
73
- */
74
- parse(value: StoredQueue | string): Partial<StoredQueue>;
75
- }
76
- export declare class Queue {
77
- readonly tracks: (Track | UnresolvedTrack)[];
78
- readonly previous: Track[];
79
- current: Track | null;
80
- options: {
81
- maxPreviousTracks: number;
82
- };
83
- private readonly guildId;
84
- private readonly QueueSaver;
85
- private managerUtils;
86
- private queueChanges;
87
- /**
88
- * Create a new Queue
89
- * @param guildId The guild ID
90
- * @param data The data to initialize the queue with
91
- * @param QueueSaver The queue saver to use
92
- * @param queueOptions
93
- */
94
- constructor(guildId: string, data?: Partial<StoredQueue>, QueueSaver?: QueueSaver, queueOptions?: ManagerQueueOptions);
95
- /**
96
- * Utils for a Queue
97
- */
98
- utils: {
99
- /**
100
- * Save the current cached Queue on the database/server (overides the server)
101
- */
102
- save: () => Promise<boolean | void>;
103
- /**
104
- * Sync the current queue database/server with the cached one
105
- * @returns {void}
106
- */
107
- sync: (override?: boolean, dontSyncCurrent?: boolean) => Promise<void>;
108
- destroy: () => Promise<boolean | void>;
109
- /**
110
- * @returns {{current:Track|null, previous:Track[], tracks:Track[]}}The Queue, but in a raw State, which allows easier handling for the QueueStoreManager
111
- */
112
- toJSON: () => StoredQueue;
113
- /**
114
- * Get the Total Duration of the Queue-Songs summed up
115
- * @returns {number}
116
- */
117
- totalDuration: () => number;
118
- };
119
- /**
120
- * Shuffles the current Queue, then saves it
121
- * @returns Amount of Tracks in the Queue
122
- */
123
- shuffle(): Promise<number>;
124
- /**
125
- * Add a Track to the Queue, and after saved in the "db" it returns the amount of the Tracks
126
- * @param {Track | Track[]} TrackOrTracks
127
- * @param {number} index At what position to add the Track
128
- * @returns {number} Queue-Size (for the next Tracks)
129
- */
130
- add(TrackOrTracks: Track | UnresolvedTrack | (Track | UnresolvedTrack)[], index?: number): any;
131
- /**
132
- * Splice the tracks in the Queue
133
- * @param {number} index Where to remove the Track
134
- * @param {number} amount How many Tracks to remove?
135
- * @param {Track | Track[]} TrackOrTracks Want to Add more Tracks?
136
- * @returns {Track} Spliced Track
137
- */
138
- splice(index: number, amount: number, TrackOrTracks?: Track | UnresolvedTrack | (Track | UnresolvedTrack)[]): any;
139
- /**
140
- * Remove stuff from the queue.tracks array
141
- * - single Track | UnresolvedTrack
142
- * - multiple Track | UnresovedTrack
143
- * - at the index or multiple indexes
144
- * @param removeQueryTrack
145
- * @returns null (if nothing was removed) / { removed } where removed is an array with all removed elements
146
- *
147
- * @example
148
- * ```js
149
- * // remove single track
150
- *
151
- * const track = player.queue.tracks[4];
152
- * await player.queue.remove(track);
153
- *
154
- * // if you already have the index you can straight up pass it too
155
- * await player.queue.remove(4);
156
- *
157
- *
158
- * // if you want to remove multiple tracks, e.g. from position 4 to position 10 you can do smt like this
159
- * await player.queue.remove(player.queue.tracks.slice(4, 10)) // get's the tracks from 4 - 10, which then get's found in the remove function to be removed
160
- *
161
- * // I still highly suggest to use .splice!
162
- *
163
- * await player.queue.splice(4, 10); // removes at index 4, 10 tracks
164
- *
165
- * await player.queue.splice(1, 1); // removes at index 1, 1 track
166
- *
167
- * await player.queue.splice(4, 0, ...tracks) // removes 0 tracks at position 4, and then inserts all tracks after position 4.
168
- * ```
169
- */
170
- remove<T extends Track | UnresolvedTrack | number | Track[] | UnresolvedTrack[] | number[] | (number | Track | UnresolvedTrack)[]>(removeQueryTrack: T): Promise<{
171
- removed: (Track | UnresolvedTrack)[];
172
- } | null>;
173
- /**
174
- * Shifts the previous array, to return the last previous track & thus remove it from the previous queue
175
- * @returns
176
- *
177
- * @example
178
- * ```js
179
- * // example on how to play the previous track again
180
- * const previous = await player.queue.shiftPrevious(); // get the previous track and remove it from the previous queue array!!
181
- * if(!previous) return console.error("No previous track found");
182
- * await player.play({ clientTrack: previous }); // play it again
183
- * ```
184
- */
185
- shiftPrevious(): Promise<Track>;
186
- }
@@ -1,190 +0,0 @@
1
- import type { FloatNumber, IntegerNumber } from "./Utils";
2
- /** The Audio Outputs type */
3
- export type AudioOutputs = "mono" | "stereo" | "left" | "right";
4
- /** The "active" / "disabled" Player Filters */
5
- export interface PlayerFilters {
6
- /** Sets nightcore to false, and vaporwave to false */
7
- custom: boolean;
8
- /** Sets custom to false, and vaporwave to false */
9
- nightcore: boolean;
10
- /** Sets custom to false, and nightcore to false */
11
- vaporwave: boolean;
12
- /** If rotation filter is enabled / not */
13
- rotation: boolean;
14
- /** if karaoke filter is enabled / not */
15
- karaoke: boolean;
16
- /** if tremolo filter is enabled / not */
17
- tremolo: boolean;
18
- /** if vibrato filter is enabled / not */
19
- vibrato: boolean;
20
- lowPass: boolean;
21
- /** audio Output (default stereo, mono sounds the fullest and best for not-stereo tracks) */
22
- audioOutput: AudioOutputs;
23
- /** Lavalink Volume FILTER (not player Volume, think of it as a gain booster) */
24
- volume: boolean;
25
- /** Filters for the Lavalink Filter Plugin */
26
- lavalinkFilterPlugin: {
27
- /** if echo filter is enabled / not */
28
- echo: boolean;
29
- /** if reverb filter is enabled / not */
30
- reverb: boolean;
31
- };
32
- lavalinkLavaDspxPlugin: {
33
- /** if lowPass filter is enabled / not */
34
- lowPass: boolean;
35
- /** if highPass filter is enabled / not */
36
- highPass: boolean;
37
- /** if normalization filter is enabled / not */
38
- normalization: boolean;
39
- /** if echo filter is enabled / not */
40
- echo: boolean;
41
- };
42
- }
43
- /**
44
- * There are 15 bands (0-14) that can be changed.
45
- * "gain" is the multiplier for the given band.
46
- * The default value is 0.
47
- * 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.
48
- * Modifying the gain could also change the volume of the output.
49
- */
50
- export interface EQBand {
51
- /** On what band position (0-14) it should work */
52
- band: IntegerNumber | number;
53
- /** The gain (-0.25 to 1.0) */
54
- gain: FloatNumber | number;
55
- }
56
- /**
57
- * Uses equalization to eliminate part of a band, usually targeting vocals.
58
- */
59
- export interface KaraokeFilter {
60
- /** The level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect) */
61
- level?: number;
62
- /** The mono level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect) */
63
- monoLevel?: number;
64
- /** The filter band (in Hz) */
65
- filterBand?: number;
66
- /** The filter width */
67
- filterWidth?: number;
68
- }
69
- /**
70
- * Changes the speed, pitch, and rate
71
- */
72
- export interface TimescaleFilter {
73
- /** The playback speed 0.0 ≤ x */
74
- speed?: number;
75
- /** The pitch 0.0 ≤ x */
76
- pitch?: number;
77
- /** The rate 0.0 ≤ x */
78
- rate?: number;
79
- }
80
- /**
81
- * Uses amplification to create a shuddering effect, where the volume quickly oscillates.
82
- * Demo: https://en.wikipedia.org/wiki/File:Fuse_Electronics_Tremolo_MK-III_Quick_Demo.ogv
83
- */
84
- export interface TremoloFilter {
85
- /** The frequency 0.0 < x */
86
- frequency?: number;
87
- /** The tremolo depth 0.0 < x ≤ 1.0 */
88
- depth?: number;
89
- }
90
- /**
91
- * Similar to tremolo. While tremolo oscillates the volume, vibrato oscillates the pitch.
92
- */
93
- export interface VibratoFilter {
94
- /** The frequency 0.0 < x ≤ 14.0 */
95
- frequency?: number;
96
- /** The vibrato depth 0.0 < x ≤ 1.0 */
97
- depth?: number;
98
- }
99
- /**
100
- * Rotates the sound around the stereo channels/user headphones (aka Audio Panning).
101
- * It can produce an effect similar to https://youtu.be/QB9EB8mTKcc (without the reverb).
102
- */
103
- export interface RotationFilter {
104
- /** The frequency of the audio rotating around the listener in Hz. 0.2 is similar to the example video above */
105
- rotationHz?: number;
106
- }
107
- /**
108
- * Distortion effect. It can generate some pretty unique audio effects.
109
- */
110
- export interface DistortionFilter {
111
- sinOffset?: number;
112
- sinScale?: number;
113
- cosOffset?: number;
114
- cosScale?: number;
115
- tanOffset?: number;
116
- tanScale?: number;
117
- offset?: number;
118
- scale?: number;
119
- }
120
- /**
121
- * Mixes both channels (left and right), with a configurable factor on how much each channel affects the other.
122
- * With the defaults, both channels are kept independent of each other.
123
- * Setting all factors to 0.5 means both channels get the same audio.
124
- */
125
- export interface ChannelMixFilter {
126
- /** The left to left channel mix factor (0.0 ≤ x ≤ 1.0) */
127
- leftToLeft?: number;
128
- /** The left to right channel mix factor (0.0 ≤ x ≤ 1.0) */
129
- leftToRight?: number;
130
- /** The right to left channel mix factor (0.0 ≤ x ≤ 1.0) */
131
- rightToLeft?: number;
132
- /** The right to right channel mix factor (0.0 ≤ x ≤ 1.0) */
133
- rightToRight?: number;
134
- }
135
- /**
136
- * Higher frequencies get suppressed, while lower frequencies pass through this filter, thus the name low pass.
137
- * Any smoothing values equal to or less than 1.0 will disable the filter.
138
- */
139
- export interface LowPassFilter {
140
- /** The smoothing factor (1.0 < x) */
141
- smoothing?: number;
142
- }
143
- /**
144
- * Filter Data stored in the Client and partially sent to Lavalink
145
- */
146
- export interface FilterData {
147
- volume?: number;
148
- karaoke?: KaraokeFilter;
149
- timescale?: TimescaleFilter;
150
- tremolo?: TremoloFilter;
151
- vibrato?: VibratoFilter;
152
- rotation?: RotationFilter;
153
- distortion?: DistortionFilter;
154
- channelMix?: ChannelMixFilter;
155
- lowPass?: LowPassFilter;
156
- pluginFilters?: {
157
- "lavalink-filter-plugin"?: {
158
- "echo"?: {
159
- delay?: number;
160
- decay?: number;
161
- };
162
- "reverb"?: {
163
- delays?: number[];
164
- gains?: number[];
165
- };
166
- };
167
- "high-pass"?: {
168
- cutoffFrequency?: number;
169
- boostFactor?: number;
170
- };
171
- "low-pass"?: {
172
- cutoffFrequency?: number;
173
- boostFactor?: number;
174
- };
175
- normalization?: {
176
- maxAmplitude?: number;
177
- adaptive?: boolean;
178
- };
179
- echo?: {
180
- echoLength?: number;
181
- decay?: number;
182
- };
183
- };
184
- }
185
- /**
186
- * Actual Filter Data sent to Lavalink
187
- */
188
- export interface LavalinkFilterData extends FilterData {
189
- equalizer?: EQBand[];
190
- }