This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 110
Playback ends unexpectedly in the middle of the audio. #117
Comments
This seems like a connection error with FFmpeg that could be solved by setting the const { StreamType, createAudioResource } = require('@discordjs/voice');
const { FFmpeg } = require('prism-media');
const FFMPEG_OPUS_ARGUMENTS = [
'-analyzeduration',
'0',
'-loglevel',
'0',
'-acodec',
'libopus',
'-f',
'opus',
'-ar',
'48000',
'-ac',
'2',
];
const stream = new prism.FFmpeg({
args: ['-reconnect_streamed', '1', '-reconnect_at_eof', '1', '-reconnect_on_network_error', '1', '-reconnect_on_http_error', '1', '-reconnect_delay_max', '5', '-i', 'your url here', ...FFMPEG_OPUS_ARGUMENTS],
});
const resource = createAudioResource(stream, { inputType: StreamType.OggOpus }); |
It seems certain that it is a connection-related issue with FFmpeg.
|
This was referenced Jun 27, 2021
Closed
Unfortunately, links from YouTube do not play :( |
I've tried using prism-media. I even used the example from here word-for-word, and it didn't work. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When playing the audio from dropbox, the playback ends unexpectedly in the middle of the audio without throwing an error.
However, when playing the downloaded audio file, it will play to the end without any issue.
ends unexpectedly
play to the end
Windows 10
Ubuntu 20.04(WSL2)
Relevant client options:
play to the end
ends unexpectedly
The text was updated successfully, but these errors were encountered: