qeled / discordie

Predictable JavaScript abstractions for Discord API.
https://qeled.github.io/discordie/
BSD 2-Clause "Simplified" License
190 stars 45 forks source link

Audio Stream Lag past 20 connections #73

Closed Mochlate closed 7 years ago

Mochlate commented 7 years ago

I am running my bot on a machine with 4 cores and 8gb ram.

Once my bot gets above like 20 voice connections streaming music the audio starts to get laggy.

Why is this happening?

macdja38 commented 7 years ago

What's the CPU usage of your process?

If your streaming from something like youtube make sure your making a car-full choice in which URL you pass to discordie. I develop pvpcraft and while it used to use discord.js It used the voice components of discordie and the https://qeled.github.io/discordie/#/docs/WebmOpusPlayer?_k=jnq6h0 is absolutely fantastic if you have a webm source. If a webm source is not available you can fallback to ffmpeg and all that. So long as the majority of your streams have a webm source available though you should see a massive performance improvement. Aside from that try sharding.