magmastream 2.9.3-dev.25 → 2.9.3-dev.26
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/config/blockedWords.d.ts +1 -0
- package/dist/index.d.ts +19 -3781
- package/dist/statestorage/JsonQueue.d.ts +173 -0
- package/dist/statestorage/JsonQueue.js +5 -2
- package/dist/statestorage/MemoryQueue.d.ts +154 -0
- package/dist/statestorage/MemoryQueue.js +6 -2
- package/dist/statestorage/RedisQueue.d.ts +178 -0
- package/dist/structures/Enums.d.ts +310 -0
- package/dist/structures/Filters.d.ts +352 -0
- package/dist/structures/MagmastreamError.d.ts +14 -0
- package/dist/structures/Manager.d.ts +259 -0
- package/dist/structures/Manager.js +200 -368
- package/dist/structures/Node.d.ts +390 -0
- package/dist/structures/Player.d.ts +347 -0
- package/dist/structures/Plugin.d.ts +23 -0
- package/dist/structures/Rest.d.ts +93 -0
- package/dist/structures/Types.d.ts +1315 -0
- package/dist/structures/Utils.d.ts +169 -0
- package/dist/structures/Utils.js +19 -1
- package/dist/utils/filtersEqualizers.d.ts +16 -0
- package/dist/utils/managerCheck.d.ts +7 -0
- package/dist/utils/nodeCheck.d.ts +7 -0
- package/dist/utils/playerCheck.d.ts +7 -0
- package/dist/wrappers/discord.js.d.ts +15 -0
- package/dist/wrappers/discordeno.d.ts +19 -0
- package/dist/wrappers/eris.d.ts +15 -0
- package/dist/wrappers/oceanic.d.ts +15 -0
- package/dist/wrappers/seyfert.d.ts +37 -0
- package/package.json +2 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State Storage Enum
|
|
3
|
+
*/
|
|
4
|
+
export declare enum StateStorageType {
|
|
5
|
+
Memory = "memory",
|
|
6
|
+
Redis = "redis",
|
|
7
|
+
JSON = "json"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* AutoPlay Platform Enum
|
|
11
|
+
*/
|
|
12
|
+
export declare enum AutoPlayPlatform {
|
|
13
|
+
Spotify = "spotify",
|
|
14
|
+
Deezer = "deezer",
|
|
15
|
+
SoundCloud = "soundcloud",
|
|
16
|
+
Tidal = "tidal",
|
|
17
|
+
VKMusic = "vkmusic",
|
|
18
|
+
Qobuz = "qobuz",
|
|
19
|
+
YouTube = "youtube"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* State Types Enum
|
|
23
|
+
*/
|
|
24
|
+
export declare enum StateTypes {
|
|
25
|
+
Connected = "CONNECTED",
|
|
26
|
+
Connecting = "CONNECTING",
|
|
27
|
+
Disconnected = "DISCONNECTED",
|
|
28
|
+
Disconnecting = "DISCONNECTING",
|
|
29
|
+
Destroying = "DESTROYING"
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Load Types Enum
|
|
33
|
+
*/
|
|
34
|
+
export declare enum LoadTypes {
|
|
35
|
+
Track = "track",
|
|
36
|
+
Playlist = "playlist",
|
|
37
|
+
Search = "search",
|
|
38
|
+
Empty = "empty",
|
|
39
|
+
Error = "error",
|
|
40
|
+
/** Nodelink */
|
|
41
|
+
Album = "album",
|
|
42
|
+
/** Nodelink */
|
|
43
|
+
Artist = "artist",
|
|
44
|
+
/** Nodelink */
|
|
45
|
+
Station = "station",
|
|
46
|
+
/** Nodelink */
|
|
47
|
+
Podcast = "podcast",
|
|
48
|
+
/** Nodelink */
|
|
49
|
+
Show = "show",
|
|
50
|
+
/** Nodelink */
|
|
51
|
+
Short = "short"
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Search Platform Enum
|
|
55
|
+
*/
|
|
56
|
+
export declare enum SearchPlatform {
|
|
57
|
+
AppleMusic = "amsearch",
|
|
58
|
+
Audius = "audsearch",
|
|
59
|
+
Bandcamp = "bcsearch",
|
|
60
|
+
Deezer = "dzsearch",
|
|
61
|
+
Jiosaavn = "jssearch",
|
|
62
|
+
Qobuz = "qbsearch",
|
|
63
|
+
SoundCloud = "scsearch",
|
|
64
|
+
Spotify = "spsearch",
|
|
65
|
+
Tidal = "tdsearch",
|
|
66
|
+
TTS = "speak",
|
|
67
|
+
VKMusic = "vksearch",
|
|
68
|
+
YouTube = "ytsearch",
|
|
69
|
+
YouTubeMusic = "ytmsearch"
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Player State Event Types Enum
|
|
73
|
+
*/
|
|
74
|
+
export declare enum PlayerStateEventTypes {
|
|
75
|
+
AutoPlayChange = "playerAutoplay",
|
|
76
|
+
ConnectionChange = "playerConnection",
|
|
77
|
+
RepeatChange = "playerRepeat",
|
|
78
|
+
PauseChange = "playerPause",
|
|
79
|
+
QueueChange = "queueChange",
|
|
80
|
+
TrackChange = "trackChange",
|
|
81
|
+
VolumeChange = "volumeChange",
|
|
82
|
+
ChannelChange = "channelChange",
|
|
83
|
+
PlayerCreate = "playerCreate",
|
|
84
|
+
PlayerDestroy = "playerDestroy",
|
|
85
|
+
FilterChange = "filterChange"
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Track Source Types Enum
|
|
89
|
+
*/
|
|
90
|
+
export declare enum TrackSourceTypes {
|
|
91
|
+
AppleMusic = "AppleMusic",
|
|
92
|
+
Audius = "Audius",
|
|
93
|
+
Bandcamp = "Bandcamp",
|
|
94
|
+
Deezer = "Deezer",
|
|
95
|
+
Jiosaavn = "Jiosaavn",
|
|
96
|
+
Qobuz = "Qobuz",
|
|
97
|
+
SoundCloud = "SoundCloud",
|
|
98
|
+
Spotify = "Spotify",
|
|
99
|
+
Tidal = "Tidal",
|
|
100
|
+
VKMusic = "VKMusic",
|
|
101
|
+
YouTube = "YouTube",
|
|
102
|
+
Pornhub = "Pornub",
|
|
103
|
+
TikTok = "TikTok",
|
|
104
|
+
Flowertts = "Flowertts",
|
|
105
|
+
Ocremix = "Ocremix",
|
|
106
|
+
Mixcloud = "Mixcloud",
|
|
107
|
+
Soundgasm = "Soundgasm",
|
|
108
|
+
Reddit = "Reddit",
|
|
109
|
+
Clypit = "Clypit",
|
|
110
|
+
Http = "Http",
|
|
111
|
+
Tts = "Tts"
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Use Node Options Enum
|
|
115
|
+
*/
|
|
116
|
+
export declare enum UseNodeOptions {
|
|
117
|
+
LeastLoad = "leastLoad",
|
|
118
|
+
LeastPlayers = "leastPlayers"
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Track Partial Enum
|
|
122
|
+
*/
|
|
123
|
+
export declare enum TrackPartial {
|
|
124
|
+
/** The base64 encoded string of the track */
|
|
125
|
+
Track = "track",
|
|
126
|
+
/** The title of the track */
|
|
127
|
+
Title = "title",
|
|
128
|
+
/** The track identifier */
|
|
129
|
+
Identifier = "identifier",
|
|
130
|
+
/** The author of the track */
|
|
131
|
+
Author = "author",
|
|
132
|
+
/** The length of the track in milliseconds */
|
|
133
|
+
Duration = "duration",
|
|
134
|
+
/** The ISRC of the track */
|
|
135
|
+
Isrc = "isrc",
|
|
136
|
+
/** Whether the track is seekable */
|
|
137
|
+
IsSeekable = "isSeekable",
|
|
138
|
+
/** Whether the track is a stream */
|
|
139
|
+
IsStream = "isStream",
|
|
140
|
+
/** The URI of the track */
|
|
141
|
+
Uri = "uri",
|
|
142
|
+
/** The artwork URL of the track */
|
|
143
|
+
ArtworkUrl = "artworkUrl",
|
|
144
|
+
/** The source name of the track */
|
|
145
|
+
SourceName = "sourceName",
|
|
146
|
+
/** The thumbnail of the track */
|
|
147
|
+
ThumbNail = "thumbnail",
|
|
148
|
+
/** The requester of the track */
|
|
149
|
+
Requester = "requester",
|
|
150
|
+
/** The plugin info of the track */
|
|
151
|
+
PluginInfo = "pluginInfo",
|
|
152
|
+
/** The custom data of the track */
|
|
153
|
+
CustomData = "customData",
|
|
154
|
+
/** Whether the track got autoplayed */
|
|
155
|
+
IsAutoPlay = "isAutoplay"
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Manager Event Types Enum
|
|
159
|
+
*/
|
|
160
|
+
export declare enum ManagerEventTypes {
|
|
161
|
+
ChapterStarted = "chapterStarted",
|
|
162
|
+
ChaptersLoaded = "chaptersLoaded",
|
|
163
|
+
Debug = "debug",
|
|
164
|
+
LyricsFound = "lyricsFound",
|
|
165
|
+
LyricsLine = "lyricsLine",
|
|
166
|
+
LyricsNotFound = "lyricsNotFound",
|
|
167
|
+
NodeConnect = "nodeConnect",
|
|
168
|
+
NodeCreate = "nodeCreate",
|
|
169
|
+
NodeDestroy = "nodeDestroy",
|
|
170
|
+
NodeDisconnect = "nodeDisconnect",
|
|
171
|
+
NodeError = "nodeError",
|
|
172
|
+
NodeRaw = "nodeRaw",
|
|
173
|
+
NodeReconnect = "nodeReconnect",
|
|
174
|
+
PlayerCreate = "playerCreate",
|
|
175
|
+
PlayerDestroy = "playerDestroy",
|
|
176
|
+
PlayerDisconnect = "playerDisconnect",
|
|
177
|
+
PlayerMove = "playerMove",
|
|
178
|
+
PlayerRestored = "playerRestored",
|
|
179
|
+
PlayerStateUpdate = "playerStateUpdate",
|
|
180
|
+
QueueEnd = "queueEnd",
|
|
181
|
+
RestoreComplete = "restoreComplete",
|
|
182
|
+
SegmentSkipped = "segmentSkipped",
|
|
183
|
+
SegmentsLoaded = "segmentsLoaded",
|
|
184
|
+
SocketClosed = "socketClosed",
|
|
185
|
+
TrackEnd = "trackEnd",
|
|
186
|
+
TrackError = "trackError",
|
|
187
|
+
TrackStart = "trackStart",
|
|
188
|
+
TrackStuck = "trackStuck",
|
|
189
|
+
/** Nodelink */
|
|
190
|
+
VoiceReceiverDisconnect = "voiceReceiverDisconnect",
|
|
191
|
+
/** Nodelink */
|
|
192
|
+
VoiceReceiverConnect = "voiceReceiverConnect",
|
|
193
|
+
/** Nodelink */
|
|
194
|
+
VoiceReceiverError = "voiceReceiverError",
|
|
195
|
+
/** Nodelink */
|
|
196
|
+
VoiceReceiverStartSpeaking = "voiceReceiverStartSpeaking",
|
|
197
|
+
/** Nodelink */
|
|
198
|
+
VoiceReceiverEndSpeaking = "voiceReceiverEndSpeaking"
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Track End Reason Enum
|
|
202
|
+
*/
|
|
203
|
+
export declare enum TrackEndReasonTypes {
|
|
204
|
+
Finished = "finished",
|
|
205
|
+
LoadFailed = "loadFailed",
|
|
206
|
+
Stopped = "stopped",
|
|
207
|
+
Replaced = "replaced",
|
|
208
|
+
Cleanup = "cleanup"
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Severity Types Enum
|
|
212
|
+
*/
|
|
213
|
+
export declare enum SeverityTypes {
|
|
214
|
+
Common = "common",
|
|
215
|
+
Suspicious = "suspicious",
|
|
216
|
+
Fault = "fault"
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* SponsorBlock Segment Enum
|
|
220
|
+
*/
|
|
221
|
+
export declare enum SponsorBlockSegment {
|
|
222
|
+
Filler = "filler",
|
|
223
|
+
Interaction = "interaction",
|
|
224
|
+
Intro = "intro",
|
|
225
|
+
MusicOfftopic = "music_offtopic",
|
|
226
|
+
Outro = "outro",
|
|
227
|
+
Preview = "preview",
|
|
228
|
+
SelfPromo = "selfpromo",
|
|
229
|
+
Sponsor = "sponsor"
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Available Filters Enum
|
|
233
|
+
*/
|
|
234
|
+
export declare enum AvailableFilters {
|
|
235
|
+
BassBoost = "bassboost",
|
|
236
|
+
China = "china",
|
|
237
|
+
Chipmunk = "chipmunk",
|
|
238
|
+
Darthvader = "darthvader",
|
|
239
|
+
Daycore = "daycore",
|
|
240
|
+
Demon = "demon",
|
|
241
|
+
Distort = "distort",
|
|
242
|
+
Doubletime = "doubletime",
|
|
243
|
+
Earrape = "earrape",
|
|
244
|
+
EightD = "eightD",
|
|
245
|
+
Electronic = "electronic",
|
|
246
|
+
Nightcore = "nightcore",
|
|
247
|
+
Party = "party",
|
|
248
|
+
Pop = "pop",
|
|
249
|
+
Radio = "radio",
|
|
250
|
+
SetDistortion = "setDistortion",
|
|
251
|
+
SetKaraoke = "setKaraoke",
|
|
252
|
+
SetRotation = "setRotation",
|
|
253
|
+
SetTimescale = "setTimescale",
|
|
254
|
+
Slowmo = "slowmo",
|
|
255
|
+
Soft = "soft",
|
|
256
|
+
TrebleBass = "trebleBass",
|
|
257
|
+
Tremolo = "tremolo",
|
|
258
|
+
TV = "tv",
|
|
259
|
+
Vaporwave = "vaporwave",
|
|
260
|
+
Vibrato = "vibrato"
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* MagmaStream Error Codes Enum
|
|
264
|
+
*/
|
|
265
|
+
export declare enum MagmaStreamErrorCode {
|
|
266
|
+
GENERAL_UNKNOWN = "MS_GENERAL_UNKNOWN",
|
|
267
|
+
GENERAL_TIMEOUT = "MS_GENERAL_TIMEOUT",
|
|
268
|
+
GENERAL_INVALID_MANAGER = "MS_GENERAL_INVALID_MANAGER",
|
|
269
|
+
INTENT_MISSING = "MS_INTENT_MISSING",
|
|
270
|
+
MANAGER_INIT_FAILED = "MS_MANAGER_INIT_FAILED",
|
|
271
|
+
MANAGER_INVALID_CONFIG = "MS_MANAGER_INVALID_CONFIG",
|
|
272
|
+
MANAGER_SHUTDOWN_FAILED = "MS_MANAGER_SHUTDOWN_FAILED",
|
|
273
|
+
MANAGER_NO_NODES = "MS_MANAGER_NO_NODES",
|
|
274
|
+
MANAGER_NODE_NOT_FOUND = "MS_MANAGER_NODE_NOT_FOUND",
|
|
275
|
+
MANAGER_SEARCH_FAILED = "MS_MANAGER_SEARCH_FAILED",
|
|
276
|
+
MANAGER_CLEANUP_INACTIVE_PLAYERS_FAILED = "MS_MANAGER_CLEANUP_INACTIVE_PLAYERS_FAILED",
|
|
277
|
+
NODE_INVALID_CONFIG = "MS_NODE_INVALID_CONFIG",
|
|
278
|
+
NODE_CONNECT_FAILED = "MS_NODE_CONNECT_FAILED",
|
|
279
|
+
NODE_RECONNECT_FAILED = "MS_NODE_RECONNECT_FAILED",
|
|
280
|
+
NODE_DISCONNECTED = "MS_NODE_DISCONNECTED",
|
|
281
|
+
NODE_PROTOCOL_ERROR = "MS_NODE_PROTOCOL_ERROR",
|
|
282
|
+
NODE_SESSION_IDS_LOAD_FAILED = "MS_NODE_SESSION_IDS_LOAD_FAILED",
|
|
283
|
+
NODE_SESSION_IDS_UPDATE_FAILED = "MS_NODE_SESSION_IDS_UPDATE_FAILED",
|
|
284
|
+
NODE_PLUGIN_ERROR = "MS_NODE_PLUGIN_ERROR",
|
|
285
|
+
PLAYER_INVALID_CONFIG = "MS_PLAYER_INVALID_CONFIG",
|
|
286
|
+
PLAYER_STATE_INVALID = "MS_PLAYER_STATE_INVALID",
|
|
287
|
+
PLAYER_QUEUE_EMPTY = "MS_PLAYER_QUEUE_EMPTY",
|
|
288
|
+
PLAYER_PREVIOUS_EMPTY = "MS_PLAYER_PREVIOUS_EMPTY",
|
|
289
|
+
PLAYER_INVALID_NOW_PLAYING_MESSAGE = "MS_PLAYER_INVALID_NOW_PLAYING_MESSAGE",
|
|
290
|
+
PLAYER_INVALID_AUTOPLAY = "MS_PLAYER_INVALID_AUTOPLAY",
|
|
291
|
+
PLAYER_INVALID_VOLUME = "MS_PLAYER_INVALID_VOLUME",
|
|
292
|
+
PLAYER_INVALID_REPEAT = "MS_PLAYER_INVALID_REPEAT",
|
|
293
|
+
PLAYER_INVALID_PAUSE = "MS_PLAYER_INVALID_PAUSE",
|
|
294
|
+
PLAYER_INVALID_SEEK = "MS_PLAYER_INVALID_SEEK",
|
|
295
|
+
PLAYER_MOVE_FAILED = "MS_PLAYER_MOVE_FAILED",
|
|
296
|
+
PLAYER_VOICE_RECEIVER_ERROR = "MS_PLAYER_VOICE_RECEIVER_ERROR",
|
|
297
|
+
QUEUE_REDIS_ERROR = "MS_QUEUE_REDIS_ERROR",
|
|
298
|
+
QUEUE_JSON_ERROR = "MS_QUEUE_JSON_ERROR",
|
|
299
|
+
QUEUE_MEMORY_ERROR = "MS_QUEUE_MEMORY_ERROR",
|
|
300
|
+
FILTER_APPLY_FAILED = "MS_FILTER_APPLY_FAILED",
|
|
301
|
+
REST_REQUEST_FAILED = "MS_REST_REQUEST_FAILED",
|
|
302
|
+
REST_UNAUTHORIZED = "MS_REST_UNAUTHORIZED",
|
|
303
|
+
UTILS_TRACK_PARTIAL_INVALID = "MS_UTILS_TRACK_PARTIAL_INVALID",
|
|
304
|
+
UTILS_TRACK_BUILD_FAILED = "MS_UTILS_TRACK_BUILD_FAILED",
|
|
305
|
+
UTILS_AUTOPLAY_BUILD_FAILED = "MS_UTILS_AUTOPLAY_BUILD_FAILED",
|
|
306
|
+
UTILS_PLAYER_SERIALIZE_FAILED = "MS_UTILS_PLAYER_SERIALIZE_FAILED",
|
|
307
|
+
PLUGIN_LOAD_FAILED = "MS_PLUGIN_LOAD_FAILED",
|
|
308
|
+
PLUGIN_RUNTIME_ERROR = "MS_PLUGIN_RUNTIME_ERROR"
|
|
309
|
+
}
|
|
310
|
+
export declare const MagmaStreamErrorNumbers: Record<MagmaStreamErrorCode, number>;
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Band } from "../utils/filtersEqualizers";
|
|
2
|
+
import { AvailableFilters } from "./Enums";
|
|
3
|
+
import { Manager } from "./Manager";
|
|
4
|
+
import { Player } from "./Player";
|
|
5
|
+
import { DistortionOptions, KaraokeOptions, ReverbOptions, RotationOptions, TimescaleOptions, VibratoOptions } from "./Types";
|
|
6
|
+
export declare class Filters {
|
|
7
|
+
distortion: DistortionOptions | null;
|
|
8
|
+
equalizer: Band[];
|
|
9
|
+
karaoke: KaraokeOptions | null;
|
|
10
|
+
rotation: RotationOptions | null;
|
|
11
|
+
timescale: TimescaleOptions | null;
|
|
12
|
+
vibrato: VibratoOptions | null;
|
|
13
|
+
reverb: ReverbOptions | null;
|
|
14
|
+
volume: number;
|
|
15
|
+
bassBoostlevel: number;
|
|
16
|
+
filtersStatus: Record<AvailableFilters, boolean>;
|
|
17
|
+
manager: Manager;
|
|
18
|
+
player: Player;
|
|
19
|
+
constructor(player: Player, manager: Manager);
|
|
20
|
+
/**
|
|
21
|
+
* Updates the player's audio filters.
|
|
22
|
+
*
|
|
23
|
+
* This method sends a request to the player's node to update the filter settings
|
|
24
|
+
* based on the current properties of the `Filters` instance. The filters include
|
|
25
|
+
* distortion, equalizer, karaoke, rotation, timescale, vibrato, and volume. Once
|
|
26
|
+
* the request is sent, it ensures that the player's audio output reflects the
|
|
27
|
+
* changes in filter settings.
|
|
28
|
+
*
|
|
29
|
+
* @returns {Promise<this>} - Returns a promise that resolves to the current instance
|
|
30
|
+
* of the Filters class for method chaining.
|
|
31
|
+
*/
|
|
32
|
+
updateFilters(): Promise<this>;
|
|
33
|
+
/**
|
|
34
|
+
* Applies a specific filter to the player.
|
|
35
|
+
*
|
|
36
|
+
* This method allows you to set the value of a specific filter property.
|
|
37
|
+
* The filter property must be a valid key of the Filters object.
|
|
38
|
+
*
|
|
39
|
+
* @param {{ property: T; value: Filters[T] }} filter - An object containing the filter property and value.
|
|
40
|
+
* @param {boolean} [updateFilters=true] - Whether to update the filters after applying the filter.
|
|
41
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
42
|
+
*/
|
|
43
|
+
private applyFilter;
|
|
44
|
+
private emitPlayersTasteUpdate;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the status of a specific filter.
|
|
47
|
+
*
|
|
48
|
+
* This method updates the filter status to either true or false, indicating whether
|
|
49
|
+
* the filter is applied or not. This helps track which filters are active.
|
|
50
|
+
*
|
|
51
|
+
* @param {AvailableFilters} filter - The filter to update.
|
|
52
|
+
* @param {boolean} status - The status to set (true for active, false for inactive).
|
|
53
|
+
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
54
|
+
*/
|
|
55
|
+
private setFilterStatus;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves the status of a specific filter.
|
|
58
|
+
*
|
|
59
|
+
* This method returns whether a specific filter is currently applied or not.
|
|
60
|
+
*
|
|
61
|
+
* @param {AvailableFilters} filter - The filter to check.
|
|
62
|
+
* @returns {boolean} - Returns true if the filter is active, false otherwise.
|
|
63
|
+
*/
|
|
64
|
+
getFilterStatus(filter: AvailableFilters): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Clears all filters applied to the audio.
|
|
67
|
+
*
|
|
68
|
+
* This method resets all filter settings to their default values and removes any
|
|
69
|
+
* active filters from the player.
|
|
70
|
+
*
|
|
71
|
+
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
72
|
+
*/
|
|
73
|
+
clearFilters(): Promise<this>;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the own equalizer bands on the audio.
|
|
76
|
+
*
|
|
77
|
+
* This method adjusts the equalization curve of the player's audio output,
|
|
78
|
+
* allowing you to control the frequency response.
|
|
79
|
+
*
|
|
80
|
+
* @param {Band[]} [bands] - The equalizer bands to apply (band, gain).
|
|
81
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
82
|
+
*/
|
|
83
|
+
setEqualizer(bands?: Band[]): Promise<this>;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the own karaoke options to the audio.
|
|
86
|
+
*
|
|
87
|
+
* This method adjusts the audio so that it sounds like a karaoke song, with the
|
|
88
|
+
* original vocals removed. Note that not all songs can be successfully made into
|
|
89
|
+
* karaoke tracks, and some tracks may not sound as good.
|
|
90
|
+
*
|
|
91
|
+
* @param {KaraokeOptions} [karaoke] - The karaoke settings to apply (level, monoLevel, filterBand, filterWidth).
|
|
92
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
93
|
+
*/
|
|
94
|
+
setKaraoke(karaoke?: KaraokeOptions): Promise<this>;
|
|
95
|
+
/**
|
|
96
|
+
* Sets the own timescale options to the audio.
|
|
97
|
+
*
|
|
98
|
+
* This method adjusts the speed and pitch of the audio, allowing you to control the playback speed.
|
|
99
|
+
*
|
|
100
|
+
* @param {TimescaleOptions} [timescale] - The timescale settings to apply (speed and pitch).
|
|
101
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
102
|
+
*/
|
|
103
|
+
setTimescale(timescale?: TimescaleOptions): Promise<this>;
|
|
104
|
+
/**
|
|
105
|
+
* Sets the own vibrato options to the audio.
|
|
106
|
+
*
|
|
107
|
+
* This method applies a vibrato effect to the audio, which adds a wavering,
|
|
108
|
+
* pulsing quality to the sound. The effect is created by rapidly varying the
|
|
109
|
+
* pitch of the audio.
|
|
110
|
+
*
|
|
111
|
+
* @param {VibratoOptions} [vibrato] - The vibrato settings to apply (frequency, depth).
|
|
112
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
113
|
+
*/
|
|
114
|
+
setVibrato(vibrato?: VibratoOptions): Promise<this>;
|
|
115
|
+
/**
|
|
116
|
+
* Sets the own rotation options effect to the audio.
|
|
117
|
+
*
|
|
118
|
+
* This method applies a rotation effect to the audio, which simulates the sound
|
|
119
|
+
* moving around the listener's head. This effect can create a dynamic and immersive
|
|
120
|
+
* audio experience by altering the directionality of the sound.
|
|
121
|
+
*
|
|
122
|
+
* @param {RotationOptions} [rotation] - The rotation settings to apply (rotationHz).
|
|
123
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
124
|
+
*/
|
|
125
|
+
setRotation(rotation?: RotationOptions): Promise<this>;
|
|
126
|
+
/**
|
|
127
|
+
* Sets the own distortion options effect to the audio.
|
|
128
|
+
*
|
|
129
|
+
* This method applies a distortion effect to the audio, which adds a rougher,
|
|
130
|
+
* more intense quality to the sound. The effect is created by altering the
|
|
131
|
+
* audio signal to create a more jagged, irregular waveform.
|
|
132
|
+
*
|
|
133
|
+
* @param {DistortionOptions} [distortion] - The distortion settings to apply (sinOffset, sinScale, cosOffset, cosScale, tanOffset, tanScale, offset, scale).
|
|
134
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
135
|
+
*/
|
|
136
|
+
setDistortion(distortion?: DistortionOptions): Promise<this>;
|
|
137
|
+
/**
|
|
138
|
+
* Sets the bass boost level on the audio.
|
|
139
|
+
*
|
|
140
|
+
* This method scales the gain of a predefined equalizer curve to the specified level.
|
|
141
|
+
* The curve is designed to emphasize or reduce low frequencies, creating a bass-heavy
|
|
142
|
+
* or bass-reduced effect.
|
|
143
|
+
*
|
|
144
|
+
* @param {number} level - The level of bass boost to apply. The value ranges from -3 to 3,
|
|
145
|
+
* where negative values reduce bass, 0 disables the effect,
|
|
146
|
+
* and positive values increase bass.
|
|
147
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* // Apply different levels of bass boost or reduction:
|
|
151
|
+
* await player.bassBoost(3); // Maximum Bass Boost
|
|
152
|
+
* await player.bassBoost(2); // Medium Bass Boost
|
|
153
|
+
* await player.bassBoost(1); // Mild Bass Boost
|
|
154
|
+
* await player.bassBoost(0); // No Effect (Disabled)
|
|
155
|
+
* await player.bassBoost(-1); // Mild Bass Reduction
|
|
156
|
+
* await player.bassBoost(-2); // Medium Bass Reduction
|
|
157
|
+
* await player.bassBoost(-3); // Maximum Bass Removal
|
|
158
|
+
*/
|
|
159
|
+
bassBoost(stage: number): Promise<this>;
|
|
160
|
+
/**
|
|
161
|
+
* Toggles the chipmunk effect on the audio.
|
|
162
|
+
*
|
|
163
|
+
* This method applies or removes a chipmunk effect by adjusting the timescale settings.
|
|
164
|
+
* When enabled, it increases the speed, pitch, and rate of the audio, resulting in a high-pitched, fast playback
|
|
165
|
+
* similar to the sound of a chipmunk.
|
|
166
|
+
*
|
|
167
|
+
* @param {boolean} status - Whether to enable or disable the chipmunk effect.
|
|
168
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
169
|
+
*/
|
|
170
|
+
chipmunk(status: boolean): Promise<this>;
|
|
171
|
+
/**
|
|
172
|
+
* Toggles the "China" effect on the audio.
|
|
173
|
+
*
|
|
174
|
+
* This method applies or removes a filter that reduces the pitch of the audio by half,
|
|
175
|
+
* without changing the speed or rate. This creates a "hollow" or "echoey" sound.
|
|
176
|
+
*
|
|
177
|
+
* @param {boolean} status - Whether to enable or disable the "China" effect.
|
|
178
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
179
|
+
*/
|
|
180
|
+
china(status: boolean): Promise<this>;
|
|
181
|
+
/**
|
|
182
|
+
* Toggles the 8D audio effect on the audio.
|
|
183
|
+
*
|
|
184
|
+
* This method applies or removes an 8D audio effect by adjusting the rotation settings.
|
|
185
|
+
* When enabled, it creates a sensation of the audio moving around the listener's head,
|
|
186
|
+
* providing an immersive audio experience.
|
|
187
|
+
*
|
|
188
|
+
* @param {boolean} status - Whether to enable or disable the 8D effect.
|
|
189
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
190
|
+
*/
|
|
191
|
+
eightD(status: boolean): Promise<this>;
|
|
192
|
+
/**
|
|
193
|
+
* Toggles the nightcore effect on the audio.
|
|
194
|
+
*
|
|
195
|
+
* This method applies or removes a nightcore effect by adjusting the timescale settings.
|
|
196
|
+
* When enabled, it increases the speed and pitch of the audio, giving it a more
|
|
197
|
+
* upbeat and energetic feel.
|
|
198
|
+
*
|
|
199
|
+
* @param {boolean} status - Whether to enable or disable the nightcore effect.
|
|
200
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
201
|
+
*/
|
|
202
|
+
nightcore(status: boolean): Promise<this>;
|
|
203
|
+
/**
|
|
204
|
+
* Toggles the slowmo effect on the audio.
|
|
205
|
+
*
|
|
206
|
+
* This method applies or removes a slowmo effect by adjusting the timescale settings.
|
|
207
|
+
* When enabled, it slows down the audio while keeping the pitch the same, giving it
|
|
208
|
+
* a more relaxed and calming feel.
|
|
209
|
+
*
|
|
210
|
+
* @param {boolean} status - Whether to enable or disable the slowmo effect.
|
|
211
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
212
|
+
*/
|
|
213
|
+
slowmo(status: boolean): Promise<this>;
|
|
214
|
+
/**
|
|
215
|
+
* Toggles a soft equalizer effect to the audio.
|
|
216
|
+
*
|
|
217
|
+
* This method applies or removes a soft equalizer effect by adjusting the equalizer settings.
|
|
218
|
+
* When enabled, it reduces the bass and treble frequencies, giving the audio a softer and more
|
|
219
|
+
* mellow sound.
|
|
220
|
+
*
|
|
221
|
+
* @param {boolean} status - Whether to enable or disable the soft equalizer effect.
|
|
222
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
223
|
+
*/
|
|
224
|
+
soft(status: boolean): Promise<this>;
|
|
225
|
+
/**
|
|
226
|
+
* Toggles the TV equalizer effect on the audio.
|
|
227
|
+
*
|
|
228
|
+
* This method applies or removes a TV equalizer effect by adjusting the equalizer settings.
|
|
229
|
+
* When enabled, it enhances specific frequency bands to mimic the audio characteristics
|
|
230
|
+
* typically found in television audio outputs.
|
|
231
|
+
*
|
|
232
|
+
* @param {boolean} status - Whether to enable or disable the TV equalizer effect.
|
|
233
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
234
|
+
*/
|
|
235
|
+
tv(status: boolean): Promise<this>;
|
|
236
|
+
/**
|
|
237
|
+
* Toggles the treble/bass equalizer effect on the audio.
|
|
238
|
+
*
|
|
239
|
+
* This method applies or removes a treble/bass equalizer effect by adjusting the equalizer settings.
|
|
240
|
+
* When enabled, it enhances the treble and bass frequencies, giving the audio a more balanced sound.
|
|
241
|
+
*
|
|
242
|
+
* @param {boolean} status - Whether to enable or disable the treble/bass equalizer effect.
|
|
243
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
244
|
+
*/
|
|
245
|
+
trebleBass(status: boolean): Promise<this>;
|
|
246
|
+
/**
|
|
247
|
+
* Toggles the vaporwave effect on the audio.
|
|
248
|
+
*
|
|
249
|
+
* This method applies or removes a vaporwave effect by adjusting the equalizer settings.
|
|
250
|
+
* When enabled, it gives the audio a dreamy and nostalgic feel, characteristic of the vaporwave genre.
|
|
251
|
+
*
|
|
252
|
+
* @param {boolean} status - Whether to enable or disable the vaporwave effect.
|
|
253
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
254
|
+
*/
|
|
255
|
+
vaporwave(status: boolean): Promise<this>;
|
|
256
|
+
/**
|
|
257
|
+
* Toggles the distortion effect on the audio.
|
|
258
|
+
*
|
|
259
|
+
* This method applies or removes a distortion effect by adjusting the distortion settings.
|
|
260
|
+
* When enabled, it adds a rougher, more intense quality to the sound by altering the
|
|
261
|
+
* audio signal to create a more jagged, irregular waveform.
|
|
262
|
+
*
|
|
263
|
+
* @param {boolean} status - Whether to enable or disable the distortion effect.
|
|
264
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
265
|
+
*/
|
|
266
|
+
distort(status: boolean): Promise<this>;
|
|
267
|
+
/**
|
|
268
|
+
* Toggles the party effect on the audio.
|
|
269
|
+
*
|
|
270
|
+
* This method applies or removes a party effect by adjusting the equalizer settings.
|
|
271
|
+
* When enabled, it enhances the bass and treble frequencies, providing a more energetic and lively sound.
|
|
272
|
+
*
|
|
273
|
+
* @param {boolean} status - Whether to enable or disable the party effect.
|
|
274
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
275
|
+
*/
|
|
276
|
+
pop(status: boolean): Promise<this>;
|
|
277
|
+
/**
|
|
278
|
+
* Toggles a party effect on the audio.
|
|
279
|
+
*
|
|
280
|
+
* This method applies a party effect to audio.
|
|
281
|
+
* @param {boolean} status - Whether to enable or disable the party effect.
|
|
282
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
283
|
+
*/
|
|
284
|
+
party(status: boolean): Promise<this>;
|
|
285
|
+
/**
|
|
286
|
+
* Toggles earrape effect on the audio.
|
|
287
|
+
*
|
|
288
|
+
* This method applies earrape effect to audio.
|
|
289
|
+
* @param {boolean} status - Whether to enable or disable the earrape effect.
|
|
290
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
291
|
+
*/
|
|
292
|
+
earrape(status: boolean): Promise<this>;
|
|
293
|
+
/**
|
|
294
|
+
* Toggles electronic effect on the audio.
|
|
295
|
+
*
|
|
296
|
+
* This method applies electronic effect to audio.
|
|
297
|
+
* @param {boolean} status - Whether to enable or disable the electronic effect.
|
|
298
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
299
|
+
*/
|
|
300
|
+
electronic(status: boolean): Promise<this>;
|
|
301
|
+
/**
|
|
302
|
+
* Toggles radio effect on the audio.
|
|
303
|
+
*
|
|
304
|
+
* This method applies radio effect to audio.
|
|
305
|
+
* @param {boolean} status - Whether to enable or disable the radio effect.
|
|
306
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
307
|
+
*/
|
|
308
|
+
radio(status: boolean): Promise<this>;
|
|
309
|
+
/**
|
|
310
|
+
* Toggles a tremolo effect on the audio.
|
|
311
|
+
*
|
|
312
|
+
* This method applies a tremolo effect to audio.
|
|
313
|
+
* @param {boolean} status - Whether to enable or disable the tremolo effect.
|
|
314
|
+
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
315
|
+
*/
|
|
316
|
+
tremolo(status: boolean): Promise<this>;
|
|
317
|
+
/**
|
|
318
|
+
* Toggless a darthvader effect on the audio.
|
|
319
|
+
*
|
|
320
|
+
* This method applies a darthvader effect to audio.
|
|
321
|
+
* @param {boolean} status - Whether to enable or disable the darthvader effect.
|
|
322
|
+
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
323
|
+
*/
|
|
324
|
+
darthvader(status: boolean): Promise<this>;
|
|
325
|
+
/**
|
|
326
|
+
* Toggles a daycore effect on the audio.
|
|
327
|
+
*
|
|
328
|
+
* This method applies a daycore effect to audio.
|
|
329
|
+
* @param {boolean} status - Whether to enable or disable the daycore effect.
|
|
330
|
+
* @returns {this} - Returns the current instance of the Filters class for method chaining.
|
|
331
|
+
*/
|
|
332
|
+
daycore(status: boolean): Promise<this>;
|
|
333
|
+
/**
|
|
334
|
+
* Toggles a doubletime effect on the audio.
|
|
335
|
+
*
|
|
336
|
+
* This method applies a doubletime effect to audio.
|
|
337
|
+
* @param {boolean} status - Whether to enable or disable the doubletime effect.
|
|
338
|
+
* @returns {this} - Returns the current instance of the Filters class for method chaining
|
|
339
|
+
*/
|
|
340
|
+
doubletime(status: boolean): Promise<this>;
|
|
341
|
+
/**
|
|
342
|
+
* Toggles the demon effect on the audio.
|
|
343
|
+
*
|
|
344
|
+
* This method applies or removes a demon effect by adjusting the equalizer,
|
|
345
|
+
* timescale, and reverb settings. When enabled, it creates a deeper and more
|
|
346
|
+
* intense sound by lowering the pitch and adding reverb to the audio.
|
|
347
|
+
*
|
|
348
|
+
* @param {boolean} status - Whether to enable or disable the demon effect.
|
|
349
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
350
|
+
*/
|
|
351
|
+
demon(status: boolean): Promise<this>;
|
|
352
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MagmaStreamErrorCode } from "./Enums";
|
|
2
|
+
interface MagmaStreamErrorOptions<T = unknown> {
|
|
3
|
+
code: MagmaStreamErrorCode;
|
|
4
|
+
message?: string;
|
|
5
|
+
cause?: Error;
|
|
6
|
+
context?: T;
|
|
7
|
+
}
|
|
8
|
+
export declare class MagmaStreamError<T = unknown> extends Error {
|
|
9
|
+
readonly code: MagmaStreamErrorCode;
|
|
10
|
+
readonly number: number;
|
|
11
|
+
readonly context?: T;
|
|
12
|
+
constructor({ code, message, cause, context }: MagmaStreamErrorOptions<T>);
|
|
13
|
+
}
|
|
14
|
+
export {};
|