问题描述
所以基本上我有 这个问题,我得到了一个百家乐凯发k8的解决方案";但它没有用,所以我找到了一个修复程序,将 highwatermark 添加到我的代码中,以便流保持打开更长时间或任何 idk,所以这就是我的代码目前的样子
so basically i had this issue and i got given a "solution" but it didn't work, so i found a fix and that was adding highwatermark to my code so the stream stays open longer or whatever idk, so this is what my code looks like currently
const dispatcher = serverqueue.connection.play(ytdl(song.url, { filter:"audioonly", highwatermark: 1<<25 }) .on("finish", () => { const shiffed = serverqueue.songs.shift(); if (serverqueue.loop === true) { serverqueue.songs.push(shiffed); }; play(guild, serverqueue.songs[0]); }) .on("error", error => console.error(error))); dispatcher.setvolume(serverqueue.volume / 100);
但是现在我的问题是这首歌会播放大约 10 秒然后就停止了,我不知道为什么这只会让我的问题变得更糟,因为对于我看到的每个使用此百家乐凯发k8的解决方案的人来说,它都非常有效.
but now my issue is that the song will play for like 10 seconds then just stop, i have no idea why this just made my issue worse because for everyone i seen that used this solution it worked perfectly.
推荐答案
您可能想尝试将流的类型更改为 opus :
you might want to try to change the type of the stream to opus :
serverqueue.connection.play(ytdl(song.url, { filter:"audioonly", type: 'opus' });