discord-player 5.3.2-dev.2 → 5.3.2
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/Player.js +607 -583
- package/dist/Structures/ExtractorModel.js +65 -65
- package/dist/Structures/PlayerError.js +48 -48
- package/dist/Structures/Playlist.js +108 -108
- package/dist/Structures/Queue.js +830 -795
- package/dist/Structures/Track.js +155 -155
- package/dist/VoiceInterface/StreamDispatcher.js +226 -226
- package/dist/VoiceInterface/VoiceUtils.js +65 -65
- package/dist/VoiceInterface/VolumeTransformer.js +120 -120
- package/dist/index.d.ts +1224 -1163
- package/dist/index.js +38 -34
- package/dist/smoothVolume.js +15 -15
- package/dist/types/types.js +58 -58
- package/dist/utils/AudioFilters.js +95 -97
- package/dist/utils/FFmpegStream.js +53 -53
- package/dist/utils/QueryResolver.js +68 -68
- package/dist/utils/Util.js +136 -135
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.version = exports.Util = exports.StreamDispatcher = exports.VoiceUtils = exports.Track = exports.Queue = exports.QueryResolver = exports.ErrorStatusCode = exports.PlayerError = exports.Player = exports.Playlist = exports.ExtractorModel = exports.AudioFilters = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// try applying smooth volume patch on load
|
|
6
|
-
require("./smoothVolume");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
tslib_1.__exportStar(require("./
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.version = exports.Util = exports.StreamDispatcher = exports.VoiceUtils = exports.Track = exports.Queue = exports.QueryResolver = exports.ErrorStatusCode = exports.PlayerError = exports.Player = exports.Playlist = exports.ExtractorModel = exports.AudioFilters = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// try applying smooth volume patch on load
|
|
6
|
+
require("./smoothVolume");
|
|
7
|
+
const discord_js_1 = require("discord.js");
|
|
8
|
+
var AudioFilters_1 = require("./utils/AudioFilters");
|
|
9
|
+
Object.defineProperty(exports, "AudioFilters", { enumerable: true, get: function () { return AudioFilters_1.AudioFilters; } });
|
|
10
|
+
var ExtractorModel_1 = require("./Structures/ExtractorModel");
|
|
11
|
+
Object.defineProperty(exports, "ExtractorModel", { enumerable: true, get: function () { return ExtractorModel_1.ExtractorModel; } });
|
|
12
|
+
var Playlist_1 = require("./Structures/Playlist");
|
|
13
|
+
Object.defineProperty(exports, "Playlist", { enumerable: true, get: function () { return Playlist_1.Playlist; } });
|
|
14
|
+
var Player_1 = require("./Player");
|
|
15
|
+
Object.defineProperty(exports, "Player", { enumerable: true, get: function () { return Player_1.Player; } });
|
|
16
|
+
var PlayerError_1 = require("./Structures/PlayerError");
|
|
17
|
+
Object.defineProperty(exports, "PlayerError", { enumerable: true, get: function () { return PlayerError_1.PlayerError; } });
|
|
18
|
+
Object.defineProperty(exports, "ErrorStatusCode", { enumerable: true, get: function () { return PlayerError_1.ErrorStatusCode; } });
|
|
19
|
+
var QueryResolver_1 = require("./utils/QueryResolver");
|
|
20
|
+
Object.defineProperty(exports, "QueryResolver", { enumerable: true, get: function () { return QueryResolver_1.QueryResolver; } });
|
|
21
|
+
var Queue_1 = require("./Structures/Queue");
|
|
22
|
+
Object.defineProperty(exports, "Queue", { enumerable: true, get: function () { return Queue_1.Queue; } });
|
|
23
|
+
var Track_1 = require("./Structures/Track");
|
|
24
|
+
Object.defineProperty(exports, "Track", { enumerable: true, get: function () { return Track_1.Track; } });
|
|
25
|
+
var VoiceUtils_1 = require("./VoiceInterface/VoiceUtils");
|
|
26
|
+
Object.defineProperty(exports, "VoiceUtils", { enumerable: true, get: function () { return VoiceUtils_1.VoiceUtils; } });
|
|
27
|
+
var StreamDispatcher_1 = require("./VoiceInterface/StreamDispatcher");
|
|
28
|
+
Object.defineProperty(exports, "StreamDispatcher", { enumerable: true, get: function () { return StreamDispatcher_1.StreamDispatcher; } });
|
|
29
|
+
tslib_1.__exportStar(require("./VoiceInterface/VolumeTransformer"), exports);
|
|
30
|
+
var Util_1 = require("./utils/Util");
|
|
31
|
+
Object.defineProperty(exports, "Util", { enumerable: true, get: function () { return Util_1.Util; } });
|
|
32
|
+
tslib_1.__exportStar(require("./types/types"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./utils/FFmpegStream"), exports);
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
35
|
+
exports.version = require(`${__dirname}/../package.json`).version;
|
|
36
|
+
if (!discord_js_1.version.startsWith("14")) {
|
|
37
|
+
process.emitWarning(`Discord.js v${discord_js_1.version} is incompatible with Discord Player v${exports.version}! Please use >=v14.x of Discord.js`);
|
|
38
|
+
}
|
package/dist/smoothVolume.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const VolumeTransformer_1 = require("./VoiceInterface/VolumeTransformer");
|
|
4
|
-
if (!("DISABLE_DISCORD_PLAYER_SMOOTH_VOLUME" in process.env)) {
|
|
5
|
-
try {
|
|
6
|
-
// eslint-disable-next-line
|
|
7
|
-
const mod = require("prism-media");
|
|
8
|
-
if (typeof mod.VolumeTransformer.hasSmoothing !== "boolean") {
|
|
9
|
-
Reflect.set(mod, "VolumeTransformer", VolumeTransformer_1.VolumeTransformer);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
catch {
|
|
13
|
-
/* do nothing */
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const VolumeTransformer_1 = require("./VoiceInterface/VolumeTransformer");
|
|
4
|
+
if (!("DISABLE_DISCORD_PLAYER_SMOOTH_VOLUME" in process.env)) {
|
|
5
|
+
try {
|
|
6
|
+
// eslint-disable-next-line
|
|
7
|
+
const mod = require("prism-media");
|
|
8
|
+
if (typeof mod.VolumeTransformer.hasSmoothing !== "boolean") {
|
|
9
|
+
Reflect.set(mod, "VolumeTransformer", VolumeTransformer_1.VolumeTransformer);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
/* do nothing */
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/types/types.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QueueRepeatMode = exports.QueryType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The search query type
|
|
6
|
-
* This can be one of:
|
|
7
|
-
* - AUTO
|
|
8
|
-
* - YOUTUBE
|
|
9
|
-
* - YOUTUBE_PLAYLIST
|
|
10
|
-
* - SOUNDCLOUD_TRACK
|
|
11
|
-
* - SOUNDCLOUD_PLAYLIST
|
|
12
|
-
* - SOUNDCLOUD
|
|
13
|
-
* - SPOTIFY_SONG
|
|
14
|
-
* - SPOTIFY_ALBUM
|
|
15
|
-
* - SPOTIFY_PLAYLIST
|
|
16
|
-
* - FACEBOOK
|
|
17
|
-
* - VIMEO
|
|
18
|
-
* - ARBITRARY
|
|
19
|
-
* - REVERBNATION
|
|
20
|
-
* - YOUTUBE_SEARCH
|
|
21
|
-
* - YOUTUBE_VIDEO
|
|
22
|
-
* - SOUNDCLOUD_SEARCH
|
|
23
|
-
* @typedef {number} QueryType
|
|
24
|
-
*/
|
|
25
|
-
var QueryType;
|
|
26
|
-
(function (QueryType) {
|
|
27
|
-
QueryType[QueryType["AUTO"] = 0] = "AUTO";
|
|
28
|
-
QueryType[QueryType["YOUTUBE"] = 1] = "YOUTUBE";
|
|
29
|
-
QueryType[QueryType["YOUTUBE_PLAYLIST"] = 2] = "YOUTUBE_PLAYLIST";
|
|
30
|
-
QueryType[QueryType["SOUNDCLOUD_TRACK"] = 3] = "SOUNDCLOUD_TRACK";
|
|
31
|
-
QueryType[QueryType["SOUNDCLOUD_PLAYLIST"] = 4] = "SOUNDCLOUD_PLAYLIST";
|
|
32
|
-
QueryType[QueryType["SOUNDCLOUD"] = 5] = "SOUNDCLOUD";
|
|
33
|
-
QueryType[QueryType["SPOTIFY_SONG"] = 6] = "SPOTIFY_SONG";
|
|
34
|
-
QueryType[QueryType["SPOTIFY_ALBUM"] = 7] = "SPOTIFY_ALBUM";
|
|
35
|
-
QueryType[QueryType["SPOTIFY_PLAYLIST"] = 8] = "SPOTIFY_PLAYLIST";
|
|
36
|
-
QueryType[QueryType["FACEBOOK"] = 9] = "FACEBOOK";
|
|
37
|
-
QueryType[QueryType["VIMEO"] = 10] = "VIMEO";
|
|
38
|
-
QueryType[QueryType["ARBITRARY"] = 11] = "ARBITRARY";
|
|
39
|
-
QueryType[QueryType["REVERBNATION"] = 12] = "REVERBNATION";
|
|
40
|
-
QueryType[QueryType["YOUTUBE_SEARCH"] = 13] = "YOUTUBE_SEARCH";
|
|
41
|
-
QueryType[QueryType["YOUTUBE_VIDEO"] = 14] = "YOUTUBE_VIDEO";
|
|
42
|
-
QueryType[QueryType["SOUNDCLOUD_SEARCH"] = 15] = "SOUNDCLOUD_SEARCH";
|
|
43
|
-
})(QueryType = exports.QueryType || (exports.QueryType = {}));
|
|
44
|
-
/**
|
|
45
|
-
* The queue repeat mode. This can be one of:
|
|
46
|
-
* - OFF
|
|
47
|
-
* - TRACK
|
|
48
|
-
* - QUEUE
|
|
49
|
-
* - AUTOPLAY
|
|
50
|
-
* @typedef {number} QueueRepeatMode
|
|
51
|
-
*/
|
|
52
|
-
var QueueRepeatMode;
|
|
53
|
-
(function (QueueRepeatMode) {
|
|
54
|
-
QueueRepeatMode[QueueRepeatMode["OFF"] = 0] = "OFF";
|
|
55
|
-
QueueRepeatMode[QueueRepeatMode["TRACK"] = 1] = "TRACK";
|
|
56
|
-
QueueRepeatMode[QueueRepeatMode["QUEUE"] = 2] = "QUEUE";
|
|
57
|
-
QueueRepeatMode[QueueRepeatMode["AUTOPLAY"] = 3] = "AUTOPLAY";
|
|
58
|
-
})(QueueRepeatMode = exports.QueueRepeatMode || (exports.QueueRepeatMode = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueueRepeatMode = exports.QueryType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The search query type
|
|
6
|
+
* This can be one of:
|
|
7
|
+
* - AUTO
|
|
8
|
+
* - YOUTUBE
|
|
9
|
+
* - YOUTUBE_PLAYLIST
|
|
10
|
+
* - SOUNDCLOUD_TRACK
|
|
11
|
+
* - SOUNDCLOUD_PLAYLIST
|
|
12
|
+
* - SOUNDCLOUD
|
|
13
|
+
* - SPOTIFY_SONG
|
|
14
|
+
* - SPOTIFY_ALBUM
|
|
15
|
+
* - SPOTIFY_PLAYLIST
|
|
16
|
+
* - FACEBOOK
|
|
17
|
+
* - VIMEO
|
|
18
|
+
* - ARBITRARY
|
|
19
|
+
* - REVERBNATION
|
|
20
|
+
* - YOUTUBE_SEARCH
|
|
21
|
+
* - YOUTUBE_VIDEO
|
|
22
|
+
* - SOUNDCLOUD_SEARCH
|
|
23
|
+
* @typedef {number} QueryType
|
|
24
|
+
*/
|
|
25
|
+
var QueryType;
|
|
26
|
+
(function (QueryType) {
|
|
27
|
+
QueryType[QueryType["AUTO"] = 0] = "AUTO";
|
|
28
|
+
QueryType[QueryType["YOUTUBE"] = 1] = "YOUTUBE";
|
|
29
|
+
QueryType[QueryType["YOUTUBE_PLAYLIST"] = 2] = "YOUTUBE_PLAYLIST";
|
|
30
|
+
QueryType[QueryType["SOUNDCLOUD_TRACK"] = 3] = "SOUNDCLOUD_TRACK";
|
|
31
|
+
QueryType[QueryType["SOUNDCLOUD_PLAYLIST"] = 4] = "SOUNDCLOUD_PLAYLIST";
|
|
32
|
+
QueryType[QueryType["SOUNDCLOUD"] = 5] = "SOUNDCLOUD";
|
|
33
|
+
QueryType[QueryType["SPOTIFY_SONG"] = 6] = "SPOTIFY_SONG";
|
|
34
|
+
QueryType[QueryType["SPOTIFY_ALBUM"] = 7] = "SPOTIFY_ALBUM";
|
|
35
|
+
QueryType[QueryType["SPOTIFY_PLAYLIST"] = 8] = "SPOTIFY_PLAYLIST";
|
|
36
|
+
QueryType[QueryType["FACEBOOK"] = 9] = "FACEBOOK";
|
|
37
|
+
QueryType[QueryType["VIMEO"] = 10] = "VIMEO";
|
|
38
|
+
QueryType[QueryType["ARBITRARY"] = 11] = "ARBITRARY";
|
|
39
|
+
QueryType[QueryType["REVERBNATION"] = 12] = "REVERBNATION";
|
|
40
|
+
QueryType[QueryType["YOUTUBE_SEARCH"] = 13] = "YOUTUBE_SEARCH";
|
|
41
|
+
QueryType[QueryType["YOUTUBE_VIDEO"] = 14] = "YOUTUBE_VIDEO";
|
|
42
|
+
QueryType[QueryType["SOUNDCLOUD_SEARCH"] = 15] = "SOUNDCLOUD_SEARCH";
|
|
43
|
+
})(QueryType = exports.QueryType || (exports.QueryType = {}));
|
|
44
|
+
/**
|
|
45
|
+
* The queue repeat mode. This can be one of:
|
|
46
|
+
* - OFF
|
|
47
|
+
* - TRACK
|
|
48
|
+
* - QUEUE
|
|
49
|
+
* - AUTOPLAY
|
|
50
|
+
* @typedef {number} QueueRepeatMode
|
|
51
|
+
*/
|
|
52
|
+
var QueueRepeatMode;
|
|
53
|
+
(function (QueueRepeatMode) {
|
|
54
|
+
QueueRepeatMode[QueueRepeatMode["OFF"] = 0] = "OFF";
|
|
55
|
+
QueueRepeatMode[QueueRepeatMode["TRACK"] = 1] = "TRACK";
|
|
56
|
+
QueueRepeatMode[QueueRepeatMode["QUEUE"] = 2] = "QUEUE";
|
|
57
|
+
QueueRepeatMode[QueueRepeatMode["AUTOPLAY"] = 3] = "AUTOPLAY";
|
|
58
|
+
})(QueueRepeatMode = exports.QueueRepeatMode || (exports.QueueRepeatMode = {}));
|
|
@@ -1,97 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AudioFilters = void 0;
|
|
4
|
-
const bass = (g) => `bass=g=${g}:f=110:w=0.3`;
|
|
5
|
-
class AudioFilters {
|
|
6
|
-
constructor() {
|
|
7
|
-
return AudioFilters;
|
|
8
|
-
}
|
|
9
|
-
static get
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
exports.AudioFilters = AudioFilters;
|
|
97
|
-
exports.default = AudioFilters;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AudioFilters = void 0;
|
|
4
|
+
const bass = (g) => `bass=g=${g}:f=110:w=0.3`;
|
|
5
|
+
class AudioFilters {
|
|
6
|
+
constructor() {
|
|
7
|
+
return AudioFilters;
|
|
8
|
+
}
|
|
9
|
+
static get(name) {
|
|
10
|
+
return this.filters[name];
|
|
11
|
+
}
|
|
12
|
+
static has(name) {
|
|
13
|
+
return name in this.filters;
|
|
14
|
+
}
|
|
15
|
+
static *[Symbol.iterator]() {
|
|
16
|
+
for (const [k, v] of Object.entries(this.filters)) {
|
|
17
|
+
yield { name: k, value: v };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static get names() {
|
|
21
|
+
return Object.keys(this.filters);
|
|
22
|
+
}
|
|
23
|
+
// @ts-expect-error AudioFilters.length
|
|
24
|
+
static get length() {
|
|
25
|
+
return this.names.length;
|
|
26
|
+
}
|
|
27
|
+
static toString() {
|
|
28
|
+
return this.names.map((m) => this[m]).join(","); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create ffmpeg args from the specified filters name
|
|
32
|
+
* @param filter The filter name
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
static create(filters) {
|
|
36
|
+
if (!filters || !Array.isArray(filters))
|
|
37
|
+
return this.toString();
|
|
38
|
+
return filters
|
|
39
|
+
.filter((predicate) => typeof predicate === "string")
|
|
40
|
+
.map((m) => this.get(m))
|
|
41
|
+
.join(",");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Defines audio filter
|
|
45
|
+
* @param filterName The name of the filter
|
|
46
|
+
* @param value The ffmpeg args
|
|
47
|
+
*/
|
|
48
|
+
static define(filterName, value) {
|
|
49
|
+
this.filters[filterName] = value;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Defines multiple audio filters
|
|
53
|
+
* @param filtersArray Array of filters containing the filter name and ffmpeg args
|
|
54
|
+
*/
|
|
55
|
+
static defineBulk(filtersArray) {
|
|
56
|
+
filtersArray.forEach((arr) => this.define(arr.name, arr.value));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.AudioFilters = AudioFilters;
|
|
60
|
+
AudioFilters.filters = {
|
|
61
|
+
bassboost_low: bass(15),
|
|
62
|
+
bassboost: bass(20),
|
|
63
|
+
bassboost_high: bass(30),
|
|
64
|
+
"8D": "apulsator=hz=0.09",
|
|
65
|
+
vaporwave: "aresample=48000,asetrate=48000*0.8",
|
|
66
|
+
nightcore: "aresample=48000,asetrate=48000*1.25",
|
|
67
|
+
phaser: "aphaser=in_gain=0.4",
|
|
68
|
+
tremolo: "tremolo",
|
|
69
|
+
vibrato: "vibrato=f=6.5",
|
|
70
|
+
reverse: "areverse",
|
|
71
|
+
treble: "treble=g=5",
|
|
72
|
+
normalizer2: "dynaudnorm=g=101",
|
|
73
|
+
normalizer: "acompressor",
|
|
74
|
+
surrounding: "surround",
|
|
75
|
+
pulsator: "apulsator=hz=1",
|
|
76
|
+
subboost: "asubboost",
|
|
77
|
+
karaoke: "stereotools=mlev=0.03",
|
|
78
|
+
flanger: "flanger",
|
|
79
|
+
gate: "agate",
|
|
80
|
+
haas: "haas",
|
|
81
|
+
mcompand: "mcompand",
|
|
82
|
+
mono: "pan=mono|c0=.5*c0+.5*c1",
|
|
83
|
+
mstlr: "stereotools=mode=ms>lr",
|
|
84
|
+
mstrr: "stereotools=mode=ms>rr",
|
|
85
|
+
compressor: "compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6",
|
|
86
|
+
expander: "compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3",
|
|
87
|
+
softlimiter: "compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8",
|
|
88
|
+
chorus: "chorus=0.7:0.9:55:0.4:0.25:2",
|
|
89
|
+
chorus2d: "chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3",
|
|
90
|
+
chorus3d: "chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3",
|
|
91
|
+
fadein: "afade=t=in:ss=0:d=10",
|
|
92
|
+
dim: `afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'"`,
|
|
93
|
+
earrape: "channelsplit,sidechaingate=level_in=64"
|
|
94
|
+
};
|
|
95
|
+
exports.default = AudioFilters;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFFmpegStream = exports.FFMPEG_ARGS_PIPED = exports.FFMPEG_ARGS_STRING = void 0;
|
|
4
|
-
const prism_media_1 = require("prism-media");
|
|
5
|
-
function FFMPEG_ARGS_STRING(stream, fmt) {
|
|
6
|
-
// prettier-ignore
|
|
7
|
-
return [
|
|
8
|
-
"-reconnect", "1",
|
|
9
|
-
"-reconnect_streamed", "1",
|
|
10
|
-
"-reconnect_delay_max", "5",
|
|
11
|
-
"-i", stream,
|
|
12
|
-
"-analyzeduration", "0",
|
|
13
|
-
"-loglevel", "0",
|
|
14
|
-
"-f", `${typeof fmt === "string" ? fmt : "s16le"}`,
|
|
15
|
-
"-ar", "48000",
|
|
16
|
-
"-ac", "2"
|
|
17
|
-
];
|
|
18
|
-
}
|
|
19
|
-
exports.FFMPEG_ARGS_STRING = FFMPEG_ARGS_STRING;
|
|
20
|
-
function FFMPEG_ARGS_PIPED(fmt) {
|
|
21
|
-
// prettier-ignore
|
|
22
|
-
return [
|
|
23
|
-
"-analyzeduration", "0",
|
|
24
|
-
"-loglevel", "0",
|
|
25
|
-
"-f", `${typeof fmt === "string" ? fmt : "s16le"}`,
|
|
26
|
-
"-ar", "48000",
|
|
27
|
-
"-ac", "2"
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
exports.FFMPEG_ARGS_PIPED = FFMPEG_ARGS_PIPED;
|
|
31
|
-
/**
|
|
32
|
-
* Creates FFmpeg stream
|
|
33
|
-
* @param stream The source stream
|
|
34
|
-
* @param options FFmpeg stream options
|
|
35
|
-
*/
|
|
36
|
-
function createFFmpegStream(stream, options) {
|
|
37
|
-
if (options.skip && typeof stream !== "string")
|
|
38
|
-
return stream;
|
|
39
|
-
options ?? (options = {});
|
|
40
|
-
const args = typeof stream === "string" ? FFMPEG_ARGS_STRING(stream, options.fmt) : FFMPEG_ARGS_PIPED(options.fmt);
|
|
41
|
-
if (!Number.isNaN(options.seek))
|
|
42
|
-
args.unshift("-ss", String(options.seek));
|
|
43
|
-
if (Array.isArray(options.encoderArgs))
|
|
44
|
-
args.push(...options.encoderArgs);
|
|
45
|
-
const transcoder = new prism_media_1.FFmpeg({ shell: false, args });
|
|
46
|
-
transcoder.on("close", () => transcoder.destroy());
|
|
47
|
-
if (typeof stream !== "string") {
|
|
48
|
-
stream.on("error", () => transcoder.destroy());
|
|
49
|
-
stream.pipe(transcoder);
|
|
50
|
-
}
|
|
51
|
-
return transcoder;
|
|
52
|
-
}
|
|
53
|
-
exports.createFFmpegStream = createFFmpegStream;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFFmpegStream = exports.FFMPEG_ARGS_PIPED = exports.FFMPEG_ARGS_STRING = void 0;
|
|
4
|
+
const prism_media_1 = require("prism-media");
|
|
5
|
+
function FFMPEG_ARGS_STRING(stream, fmt) {
|
|
6
|
+
// prettier-ignore
|
|
7
|
+
return [
|
|
8
|
+
"-reconnect", "1",
|
|
9
|
+
"-reconnect_streamed", "1",
|
|
10
|
+
"-reconnect_delay_max", "5",
|
|
11
|
+
"-i", stream,
|
|
12
|
+
"-analyzeduration", "0",
|
|
13
|
+
"-loglevel", "0",
|
|
14
|
+
"-f", `${typeof fmt === "string" ? fmt : "s16le"}`,
|
|
15
|
+
"-ar", "48000",
|
|
16
|
+
"-ac", "2"
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
exports.FFMPEG_ARGS_STRING = FFMPEG_ARGS_STRING;
|
|
20
|
+
function FFMPEG_ARGS_PIPED(fmt) {
|
|
21
|
+
// prettier-ignore
|
|
22
|
+
return [
|
|
23
|
+
"-analyzeduration", "0",
|
|
24
|
+
"-loglevel", "0",
|
|
25
|
+
"-f", `${typeof fmt === "string" ? fmt : "s16le"}`,
|
|
26
|
+
"-ar", "48000",
|
|
27
|
+
"-ac", "2"
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
exports.FFMPEG_ARGS_PIPED = FFMPEG_ARGS_PIPED;
|
|
31
|
+
/**
|
|
32
|
+
* Creates FFmpeg stream
|
|
33
|
+
* @param stream The source stream
|
|
34
|
+
* @param options FFmpeg stream options
|
|
35
|
+
*/
|
|
36
|
+
function createFFmpegStream(stream, options) {
|
|
37
|
+
if (options.skip && typeof stream !== "string")
|
|
38
|
+
return stream;
|
|
39
|
+
options ?? (options = {});
|
|
40
|
+
const args = typeof stream === "string" ? FFMPEG_ARGS_STRING(stream, options.fmt) : FFMPEG_ARGS_PIPED(options.fmt);
|
|
41
|
+
if (!Number.isNaN(options.seek))
|
|
42
|
+
args.unshift("-ss", String(options.seek));
|
|
43
|
+
if (Array.isArray(options.encoderArgs))
|
|
44
|
+
args.push(...options.encoderArgs);
|
|
45
|
+
const transcoder = new prism_media_1.FFmpeg({ shell: false, args });
|
|
46
|
+
transcoder.on("close", () => transcoder.destroy());
|
|
47
|
+
if (typeof stream !== "string") {
|
|
48
|
+
stream.on("error", () => transcoder.destroy());
|
|
49
|
+
stream.pipe(transcoder);
|
|
50
|
+
}
|
|
51
|
+
return transcoder;
|
|
52
|
+
}
|
|
53
|
+
exports.createFFmpegStream = createFFmpegStream;
|