Add FFmpeg Args when creating an audio resource

Hey, I would like to know if it's possible to parse ffmpeg args to the ffmpeg conversion when creating an audio resource. Like : -af aresample=48000,asetrate=48000*1.25 For example. Thanks!
12 Replies
d.js toolkit
d.js toolkit4w ago
- 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!
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
I m using discordjs voice 0.18.0 and node v20.17.0
Fyphen
Fyphen3w ago
It's possible You have to use other packages such as prism-media(I strongly recommend using this), ffmpeg-static, fluent-ffmpeg though
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
prism-media is already used by discord js module by default right ?
Fyphen
Fyphen3w ago
yep
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
What you suggest is parsing the audio to ffmpeg before sending it to discord js ?
Fyphen
Fyphen3w ago
Yes
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
Will there be two ffmpeg commands ? Or discord js will not convert it again
Fyphen
Fyphen3w ago
There's gonna be two of them ah thanks
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
I see, Thanks! that's what was bothering me
pat
pat3w ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
✨𝓜𝓪𝓲𝓽𝓻𝓮𝓖𝓔𝓔𝓚ツ✨
Thanks that's how I was using it

Did you find this page helpful?