audio file that does not play from the beginning, skips and stops after a few seconds.

Hello, I have a problem using discord.js and discordjs/voice I want to play audio files from my server (locally where the discord bot is) The bot connects well in voice, the reading of the file is done well too. But playback does not start from the beginning of the audio file. The music skips and after a few seconds of listening, the music stops. I can't fix this. I tested several way of doing like using FFmpeg but it didn't change anything. I tested with discord-player but it didn't change anything. I am using NestJS to create the discord bot. I have already been able to get music streaming to work despite small jumps at times. I can't figure out where the problem is coming from. Even looking at the logs or asking chatGPT to help. Thank you for your answers. I am French, I did the translation with google. You can answer me in French or English. discord_oh_my_geek@0.0.1 /srv/apps/discord_oh_my_geek ├── @discordjs/voice@0.16.0 ├─┬ discord-player@6.6.1 │ ├── @discordjs/voice@0.16.0 deduped │ └── discord.js@14.11.0 deduped └── discord.js@14.11.0
5 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
informaweb
informaweb12mo ago
No description
informaweb
informaweb12mo ago
I've changed const resource = createAudioResource( streamingUrl, { inputType: StreamType.OggOpus, silencePaddingFrames: 0, metadata: { title: item.Name, url: streamingUrl, artwork: item.ImageTags.Primary, }, inlineVolume: true, }); but nothing change, I always have the music that doesn't start at the beginning of the song and stops before the end and I always have the jumps yes, it plays the song . the file is encoded in mp3 i have also testing without FFmpeg,. In put file directly in resource constant but it same problem. i have the sound, but don't start to begin of file and jumps and stop before the end of music all mp3 maybe flac format too, i does testing that
d.js docs
d.js docs12mo ago
guide Getting Started: Installation - Extra Dependencies read more
informaweb
informaweb12mo ago
yes -------------------------------------------------- Core Dependencies - @discordjs/voice: 0.16.0 - prism-media: 1.3.5 Opus Libraries - @discordjs/opus: 0.9.0 - opusscript: 0.0.8 Encryption Libraries - sodium-native: 4.0.4 - sodium: not found - libsodium-wrappers: 0.7.11 - tweetnacl: 1.0.3 FFmpeg - version: 5.0.1-static https://johnvansickle.com/ffmpeg/ - libopus: yes i have add sodium library i have test flac file. It's differnt. Flac file is playing directly at start of song but it's stops after 10 seconds