【问题标题】:Can't seem to find Opus engine even tough I have installed opusscript / @discordjs/opus我已经安装了 opusscript / @discordjs/opus 似乎找不到 Opus 引擎
【发布时间】:2020-05-31 06:30:56
【问题描述】:

我无法安装 node-opus,因为它给出了错误代码。

我的代码:

const Discord = require('discord.js');
const client = new Discord.Client();

client.login('my token :)');
client.on('message', message => {
  if (!message.guild) return;
  if (message.content === '/join') {
    if (message.member.voiceChannel) {
      message.member.voiceChannel.join()
      .then(connection => {
        const dispatcher = connection.playFile('./musik/taisonin.mp3');
        dispatcher.resume()
        dispatcher.on("end", end => {message.memver.voiceChannel.leave()});
      });
    } else {
      message.reply('-');
    }
  }
});

在尝试开始播放我的 mp3 文件之前,一切似乎都运行良好。 -> “错误:找不到 Opus 引擎。”

部门:

"@discordjs/opus": "^0.1.0",
"discord.js": "github:discordjs/discord.js#master",
"discord.js-commando": "github:discordjs/Commando",
"ffmpeg-static": "^4.0.1",
"opusscript": "0.0.7"

【问题讨论】:

    标签: javascript mp3 npm-install discord.js opus


    【解决方案1】:

    鉴于它们有许多重叠的功能,您可能会在尝试在 opusscript 之上安装 node-opus 时收到错误消息。

    要对您想要播放的 mp3 文件进行解码和编码,您必须安装编解码器来为您执行此操作:

    所以尝试卸载 opusscript 然后安装 npm install discord.js node-opus 就可以了。

    【讨论】:

      猜你喜欢
      • 2021-04-29
      • 2021-08-26
      • 2021-08-09
      • 2021-05-10
      • 2016-09-10
      • 1970-01-01
      • 1970-01-01
      • 2021-07-24
      • 1970-01-01
      相关资源
      最近更新 更多