Discord FFmpeg not found

2019-09-21 08:12发布

问题:

Im coding a discord bot, and now it should play music, but if i run the command, it says "ffmpeg not found",i already installed ffmpeg as programm and in the console, here is the code:

if (message.content.startsWith === `${prefix}play`) {
  const ytdl = require('ytdl-core');
  const streamOptions = {
    seek: 0,
    volume: 1
  };

  const broadcast = bot.createVoiceBroadcast();
  var link = arg1

  bot.voiceChannel.join()
    .then(connection => {
      const stream = ytdl(arg1, {
        filter: 'audioonly'
      });
      broadcast.playStream(stream);
      const dispatcher = connection.playBroadcast(broadcast);
    })
    .catch(console.error);

回答1:

Simply installing FFMPEG on your system does not allow programs to access the executable for the program. Are you on windows? If you are, you need to add the FFMPEG's executable to your PATH environment variable.