-
Notifications
You must be signed in to change notification settings - Fork 157
[Suggestion] Way to change the bot's volume #57
Comments
That's an issue with FFMPEG. var ffmpeg = spawn('ffmpeg', [ //Or 'avconv', if you have it instead
'-i', file,
'-af', 'volume=0.15',
'-f', 's16le',
'-ar', '48000',
'-ac', '2', //If you want one audio channel (mono), you can omit `stereo: true` in `getAudioContext`
'pipe:1'
], {
stdio: ['pipe', 'pipe', 'ignore']
}); |
This should be added to this line (Edit: outdated) |
The library does not need to add something to suit your needs, The library actually does not even have a way to read audio files built in for the exact reason implicated as the statement above. You should implement your own commands because ffmpeg takes many arguments, as well as the fact that adding that line would need the library to have ffmpeg as a requirement, making the library much harder to install for no reason. |
There's no other way to do it? |
You may be able to use pcm-volume to do it. You can pipe your files to the volume object instead and send that to the stream for discord. |
I don't really understand how it works? how am I supposed to do it with the youtube-dl nodejs module? |
I've waited for youtube-dl to output a file and then ran that through ffmpeg to get a PCM stream. I don't have it sounding perfect yet, sometimes there are little blips in the audio, but once you have a PCM stream you can pipe that though volume. This lets you change it almost immediately instead of though ffmpeg which I suspect you would need to wait for the next decode for it to take effect |
A function could be added in the callback with the stream in the Bot#getAudionContext because music at 100% is so high
The text was updated successfully, but these errors were encountered: