From 5b19d8178d5edb4c0aac60a8e97f60b7d52f2f8b Mon Sep 17 00:00:00 2001 From: naseif Date: Tue, 23 Nov 2021 12:28:21 +0000 Subject: [PATCH] [Experiment] testing the audio playback speed with medium settings --- modules/Music.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/Music.js b/modules/Music.js index 9d94fe7..9091a07 100644 --- a/modules/Music.js +++ b/modules/Music.js @@ -37,6 +37,12 @@ class Music { leaveOnEmptyCooldown: 60 * 1000 * 3, bufferingTimeout: 200, leaveOnEmpty: true, + ytdlOptions: { + quality: "highestaudio", + filter: "audioonly", + highWaterMark: 1 << 25, + dlChunkSize: 20, + }, metadata: { channel: command ?? undefined, }, @@ -50,7 +56,9 @@ class Music { }); if (await playdl.so_validate(track.url)) { let soundCloudInfo = await playdl.soundcloud(track.url); - return (await playdl.stream_from_info(soundCloudInfo)).stream; + return ( + await playdl.stream_from_info(soundCloudInfo, { quality: 1 }) + ).stream; } return; } @@ -66,10 +74,10 @@ class Music { let youtube = await playdl.search(`${spotifyInfo.name}`, { limit: 2, }); - return (await playdl.stream(youtube[0].url)).stream; + return (await playdl.stream(youtube[0].url, { quality: 1 })).stream; } - return (await playdl.stream(track.url)).stream; + return (await playdl.stream(track.url, { quality: 1 })).stream; } }, });