discordjs / voice

Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Apache License 2.0
328 stars 112 forks source link

Audio stuttering even when streaming from a local mp3 file #142

Closed enlyth closed 3 years ago

enlyth commented 3 years ago

Please describe the problem you are having in as much detail as possible:

I am using the reference code from the examples of this repository for the music bot without any modifications.

Even if I change the code to stream from a local .mp3 file instead of YTDL, the audio is constantly stuttering. I'm sure this is not my internet connection.

Further details: Windows 10 Build 19042, NodeJS v14.17.0, using the following dependencies:

    "@discordjs/opus": "^0.5.3",
    "@discordjs/voice": "^0.5.1",
    "ffmpeg-static": "^4.4.0",
    "libsodium-wrappers": "^0.7.9",
amishshah commented 3 years ago

A good way to debug this would be to try playing an Ogg Opus or WebM Opus audio file, e.g.

const resource = createAudioResource(
  createReadStream('./myfile.ogg'),
  { inputType: StreamType.OggOpus }
);

If you still experience stutter playing this resource, then it's likely a network connection issue. If you don't experience stutter, it's likely to be that you're not running on a powerful enough machine. Some information about your environment would be helpful here.

enlyth commented 3 years ago

Thanks, will try and report back with more environment details if it persists

enlyth commented 3 years ago

I'm not able to reproduce this issue anymore, might have actually been my connection, so closing