Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot joins but does not play any sound on Windows #69

Closed
spartansniper619 opened this issue Feb 17, 2020 · 6 comments
Closed

Bot joins but does not play any sound on Windows #69

spartansniper619 opened this issue Feb 17, 2020 · 6 comments

Comments

@spartansniper619
Copy link

spartansniper619 commented Feb 17, 2020

Hello !

Sorry to bother you, I'm very very new to all of this so I'm sorry if it's an obvious mistake on my part.

I followed steps by steps your instruction to manually build the bot and I think I've got it all fine, the bot seem very stable, no crash, the sounds list is what I put in the sounds folder path is good, and it join vocal as soon as I type a command in, the problem is that it does not play any sounds.

Nothing comes out of the bot so I checked out the command box to see is there's any error and there's is actually, just after I got the "Use the following URL to let the bot join your server!" here's what it says :

Capture

I can't even understand if it's linked to my issue lol.

Thanks in advance !

@markokajzer
Copy link
Owner

markokajzer commented Feb 18, 2020

Heyya 👋 There are two issues. First your clientId in the config.json is incorrect. It looks like you are on a bit older version and not on master, so make sure it says clientID (notice the capitalized last two letters.) Make sure it does not say client_id=undefined in the Use the following URL output.

Another thing is that the installation of some of the dependencies failed as it looks like (Error says: Could not locate bindings file). Did you follow the guide int he wiki? Windows sometimes has a problem with the dependencies unfortunately. Try yarn install again and see if that fixes the error. If not you can try the following:

  • Delete node_modules folder
  • Run yarn remove node-opus
  • Run yarn add opusscript
  • Run yarn install
  • Run yarn start again

Hopefully that should fix the issue on Windows.

Sorry for this hassle, I am working on a much much easier installation and configuration process.

@markokajzer markokajzer changed the title Bot join but can't play any sound. Bot joins but does not play any sound on Windows Feb 18, 2020
@spartansniper619
Copy link
Author

spartansniper619 commented Feb 18, 2020

So ! Thank you very much !

To answer your question yes I followed every steps from the wiki for windows.

So I did what you suggested and it's better, I don't know wich one of the solutions did it but the bot play sounds know ! But for the moment it dosen't play them all... Some won't function and sometime it plays only the begining or the end of other ones, it's buggy...

I don't know if there's a solution to that too ?

EDIT : After some testing, most of the time it dosen't work, it's rare that a sound is played in it's entirety most of the time it cut the end of it and without a buggy/glitchy sound.

EDIT2 : It's the same regardless of the lenght of the sound, I use clips from 1 second to 15-20 seconds and it makes no differences...

LASTEDIT : Well, I found my solution, I just change all of my sounds (a couple of hundred lol) and add 2 seconds of silence at the end, it still bother me a little because the bot is very slow to play a sound, between the moment I type in a command and the moment the sound play, there's 12 seconds of "loading",
I was used to have a very reactive bot by the past on another discord wich was very cool we could do "battle" of command and it was very fast and funny to have all of the sound play one after another. Here it's minimum 10 secondes of loading between each sounds

Is there a solution to that maybe ? ^^

@markokajzer
Copy link
Owner

markokajzer commented Feb 18, 2020

Hey again! Glad you figured it out at least a bit. Let me tell you that 10 seconds is definitely too much, the bot should fire all sounds one after the other without any loading time. May I ask how many sounds you have? That could be an issue. Another reason could be the use of opusscript instead of node-opus, which is highly discouraged in the discord.js docs, but should work for a small Windows setup.

As to the cutting away of the last bits of each sounds: Downgrade to Node.js v8 (here is a link). There are some weird issues with newer versions. This is not specific to my bot, but rather to the combination of Node version, discord.js version (the underlying library I use), and voice support in general. And again, this is something I am actively looking into it and working on (see PR #61).

I would recommend you to see if the downgrade to Node v8 helps (make sure to re-install all dependencies by completely removing the whole node_modules folder and running yarn install again), and trying to use node-opus instead of opusscript. As I also say in the wiki, I generally highly recommend running the bot on either a Linux or macOS based system, as there are oftentimes much less issues with it, e.g. I am running the bot on a Raspberry Pi myself. A package manager also makes the installation of the needed dependencies much easier.

I hope that helps you... You can see, that right now the bot is unfortunately aimed at people that have somewhat experience with the technology, but I hope you can figure out a way. And again, I am actively working to smoothen out the experience and provide an easier installation process. :)

@spartansniper619
Copy link
Author

Sorry for the late answer !

So I can elaborate a little bit more, the bot seems to be very reactive the first 5-6 sounds when it goes online, but ultimately it goes down and down and it's very very slow to fire sounds.

To be faire there's a lot of sounds yes, 132 and it increase every day ! I'll make some test with onlu 5 sound on the folder to see (but when I had a bot very similar to yours back in 2016-17, I had already a undred + sounds and it was working perfectly fine ^^).

I'm sorry but I'm not sure to understand what you mean by " trying to use node-opus instead of opusscript", I'm not sure how to do that ? Sadly we only have windows here, I can't use anything else really... :/

I'll try to clear the folder and re-install with node v8, praying that the bot won't die xD

Thanks a lot for your help !

@markokajzer
Copy link
Owner

Let me just tell you that I have around 300 sounds, and it usually does not slow down, so your number should be ok. Sorry for your experience :(

What I meant is that you try to make the bot work without the changes we did from my first comment. When you go back to Node v8, try to use node-opus instead of opusscript and re-install all node_modules.

@spartansniper619
Copy link
Author

spartansniper619 commented Feb 21, 2020

Oh okay fuck me sometime I just stop my brain I swear xD

i'll give you update on the situation ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants