mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 06:43:17 +00:00
version and some formatting to play func
This commit is contained in:
parent
3f1aedfef8
commit
6408cbe525
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "musix",
|
"name": "musix",
|
||||||
"version": "3.2.0",
|
"version": "3.2.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -16,7 +16,8 @@ module.exports = async function (guild, song, client, seek, play) {
|
|||||||
streamConfig.options.seek = seek;
|
streamConfig.options.seek = seek;
|
||||||
|
|
||||||
let input = song.url;
|
let input = song.url;
|
||||||
if (song.type === "ytdl") input = ytdl(song.url, streamConfig.ytdlOptions);
|
if (song.type === "ytdl")
|
||||||
|
input = ytdl(song.url, streamConfig.ytdlOptions);
|
||||||
|
|
||||||
const ffmpegArgs = [
|
const ffmpegArgs = [
|
||||||
"-analyzeduration",
|
"-analyzeduration",
|
||||||
@ -44,10 +45,12 @@ module.exports = async function (guild, song, client, seek, play) {
|
|||||||
args.unshift("-ss", String(seek));
|
args.unshift("-ss", String(seek));
|
||||||
|
|
||||||
const transcoder = new prism.FFmpeg({
|
const transcoder = new prism.FFmpeg({
|
||||||
args: args
|
args: args,
|
||||||
});
|
});
|
||||||
|
|
||||||
const stream = input.pipe(transcoder);
|
const stream = input.pipe(transcoder).on("error", (error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
const dispatcher = queue.connection
|
const dispatcher = queue.connection
|
||||||
.play(stream, streamConfig.options)
|
.play(stream, streamConfig.options)
|
||||||
|
Loading…
Reference in New Issue
Block a user