Seek option removed
In discord.js v12 there was an option to seek the audio stream while playing it like this:
But it seems to be removed, and now there isn't a way to play a stream from a different position.
I found an old issue that has some workaround code but its a bit annoying to use, when I think it should just be an option.
https://github.com/discordjs/discord.js/issues/9208
Is there any plans to add this option?
GitHub
Add seek function and audio filter by adding ffmpeg options to Audi...
Which package is this feature request for? discord.js/voice Feature Just seek, audio filter using ffmpeg. Ideal solution or implementation Add seek function and audio filter by adding ffmpeg option...
3 Replies
- What are your intents?
GuildVoiceStates
is required to receive voice data!
- Show what dependencies you are using -- generateDependencyReport()
is exported from @discordjs/voice
.
- Try looking at common examples: https://github.com/discordjs/voice-examples.
- 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!
- ✅
Marked as resolved by OPafaik no
to clarify, the snippet on that issue seems to overstep what's actually necessary
you can just pipe through an
FFmpeg
transformer with the -ss
flag, as ffmpeg is the only thing handling seeking
since createAudioResource
accepts a stream, you can just pass it the FFmpeg
transform stream
ffmpeg: https://trac.ffmpeg.org/wiki/Seeking
prism media: https://amishshah.github.io/prism-media/core.FFmpeg.htmlWould it be used like this?
I don't really like this because it cuts the actual file and if for instance you want to loop it would loop the cut file rather than the full one. It also messes up playbackDuration and you have to track how much you seeked manually.
K I guess I got it to work like before by tracking the file before seeking and the seek offset. A lot more annoying than in v12 but at least this is solved for me