izy521 / discord.io

A small, single-file library for creating DiscordApp clients from Node.js or the browser
https://discord.gg/0MvHMfHcTKVVmIGP
MIT License
535 stars 154 forks source link

ffmpeg missing, even though typing ffmpeg in the console works #225

Open gmfelix opened 7 years ago

gmfelix commented 7 years ago

Greetings everyone, I am new to discord.io and have been fiddling around with it just for fun, however, when trying to implement music streaming for the bot I receive an error: console screenshot

Code in question:

case 'play': client.getAudioContext("removedForSafety", function(err, stream) { if (err) return console.error(err); fs.createReadStream(song).pipe(stream, {end: false}); stream.on('done', function() { fs.createReadStream(song).pipe(stream, {end: false}); }); }); break;

Thanks in advance.

izy521 commented 7 years ago

Did you dump ffmpeg into the directory ...\Desktop\projects\StreamChecker, or is it added to your PATH?

gmfelix commented 7 years ago

I added it to the PATH enviroment

izy521 commented 7 years ago

Try closing and re-opening the command prompt, then.

gmfelix commented 7 years ago

I've tried that several times now, I even tried restarting the computer and also running cmd as administrator

izy521 commented 7 years ago

That's odd, then. You can check in the lib's file, it only attempts to execute ffmpeg on your shell, whatever that may be. Doesn't try to locate it, or anything. So long as the command prompt is able to run it, the lib should be able to as well.

gmfelix commented 7 years ago

Well, when I'm running the bot with 'node bot.js' the command prompt does not let me write on it, because it's busy with the process, I really don't know what is wrong. Any suggestions? Maybe a clean install of the dependencies? I am using windows 10, just in case that is an issue, maybe the version I downloaded is not compatible with your code, although if it only tries to execute 'ffmpeg' I'm not sure that is the issue

DevDive commented 7 years ago

it is broken i think Mine WOrks

HessuHobo commented 6 years ago

this is also happening on linux, quick and dirty fix is to change chooseAuidoEncoder function to return "ffmpeg" or "avconv" like so: image (i renamed hte original function)

charliesis commented 6 years ago

Was this issue ever resolved? I have the same problem