Is your feature request related to a problem? Please describe.
I noticed that Discord.js Voice doesn't support additional input parameters on ffmpeg encoder. Because of this, we cannot really tweak the sound output that much.
Describe the ideal solution
This can be implemented on the <Voice Connection>.play() options. Where in we can put the additional params on the ffmpeg along side with the default one.
Describe alternatives you've considered
I thought about recreating the readable stream, but that can become a cpu intensive workload because of double processing that happens, where in you can just use the ffmpeg to fine tune the sound.
What additional parameters would you use?
the -af equalizer
I think it'd be easier if you just use the prism module (npm i amishshah/prism-media), it's more suited to the job.
const input = getInputStream();
const transcoder = new prism.FFmpeg({
args: [
'-analyzeduration', '0',
'-loglevel', '0',
'-f', 's16le',
'-ar', '48000',
'-ac', '2',
// Add your -af equalizer here
],
});
const output = input.pipe(transcoder);
connection.play(output, { type: 'converted' });
I don't think this is something that we should add to Discord.js internally as FFmpeg arguments can get complex, and using prism yourself should be fine anyway.
Most helpful comment
I think it'd be easier if you just use the prism module (
npm i amishshah/prism-media), it's more suited to the job.I don't think this is something that we should add to Discord.js internally as FFmpeg arguments can get complex, and using prism yourself should be fine anyway.