Discord Music bot - 我播放的歌曲在结束前 10-20 秒停止,所以我添加了 highWaterMark,现在这首歌几乎没有播放
- 作者: 读着倒才猪
- 来源: 51数据库
- 2022-10-21
问题描述
所以基本上我有 这个问题,我得到了一个解决方案";但它没有用,所以我找到了一个修复程序,将 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 秒然后就停止了,我不知道为什么这只会让我的问题变得更糟,因为对于我看到的每个使用此解决方案的人来说,它都非常有效.
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' });
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
