Error [ERR_STREAM_WRITE_AFTER_END]: write after end

This appears after about 2m of playing an mp3 file I have stored locally.
let editedSong = ffmpeg({ source: `./songCache/${id}.mp3` }).toFormat('mp3').setStartTime(Math.ceil(json.payloads[0].seek_to / 1000))
resource = createAudioResource(editedSong);
let editedSong = ffmpeg({ source: `./songCache/${id}.mp3` }).toFormat('mp3').setStartTime(Math.ceil(json.payloads[0].seek_to / 1000))
resource = createAudioResource(editedSong);
10 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
PixelBlob
PixelBlobOP15mo ago
[email protected]
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at new NodeError (node:internal/errors:405:5)
at _write (node:internal/streams/writable:329:11)
at Writable.write (node:internal/streams/writable:344:10)
at Socket.ondata (node:internal/streams/readable:774:22)
at Socket.emit (node:events:511:28)
at Readable.read (node:internal/streams/readable:547:10)
at Socket.read (node:net:764:39)
at flow (node:internal/streams/readable:1031:34)
at resume_ (node:internal/streams/readable:1012:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
resource: AudioResource {
playStream: OggDemuxer {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_remainder: null,
_head: null,
_bitstream: null,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: [Function: bound onwrite]
},
edges: [ [Object], [Object] ],
metadata: null,
volume: undefined,
encoder: undefined,
audioPlayer: AudioPlayer {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_state: [Object],
subscribers: [Array],
behaviors: [Object],
debug: [Function (anonymous)],
[Symbol(kCapture)]: false
},
playbackDuration: 163760,
started: true,
silencePaddingFrames: 5,
silenceRemaining: -1
}
}
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at new NodeError (node:internal/errors:405:5)
at _write (node:internal/streams/writable:329:11)
at Writable.write (node:internal/streams/writable:344:10)
at Socket.ondata (node:internal/streams/readable:774:22)
at Socket.emit (node:events:511:28)
at Readable.read (node:internal/streams/readable:547:10)
at Socket.read (node:net:764:39)
at flow (node:internal/streams/readable:1031:34)
at resume_ (node:internal/streams/readable:1012:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
resource: AudioResource {
playStream: OggDemuxer {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_remainder: null,
_head: null,
_bitstream: null,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: [Function: bound onwrite]
},
edges: [ [Object], [Object] ],
metadata: null,
volume: undefined,
encoder: undefined,
audioPlayer: AudioPlayer {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_state: [Object],
subscribers: [Array],
behaviors: [Object],
debug: [Function (anonymous)],
[Symbol(kCapture)]: false
},
playbackDuration: 163760,
started: true,
silencePaddingFrames: 5,
silenceRemaining: -1
}
}
PixelBlob
PixelBlobOP15mo ago
would me messing with the inbuilt palyback duration be messing with anything?
No description
PixelBlob
PixelBlobOP15mo ago
nope commented it still does it tried to give that a go but it dies instantly, I might have given it the wrong args im not sure
PixelBlob
PixelBlobOP15mo ago
instantly idling with no error
No description
PixelBlob
PixelBlobOP15mo ago
if the filename is given directly to createaudioresource it works fine putting it through ffmpeg is breaking it
PixelBlob
PixelBlobOP15mo ago
No description
PixelBlob
PixelBlobOP15mo ago
fixed it but it still breaks :(
No description
PixelBlob
PixelBlobOP15mo ago
No description
PixelBlob
PixelBlobOP15mo ago
@qjuh
Want results from more Discord servers?
Add your server