Comments (7)
That's an issue with FFMPEG.
Here's my fix
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']
});
from discord.io.
This should be added to this line (Edit: outdated)
from discord.io.
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.
from discord.io.
There's no other way to do it?
from discord.io.
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.
from discord.io.
I don't really understand how it works? how am I supposed to do it with the youtube-dl nodejs module?
from discord.io.
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
from discord.io.
Related Issues (20)
- Edit embed message HOT 4
- GIF files cannot be uploaded HOT 3
- could not read
- Cannot read property 'members' of undefined
- Is it possible to log ID of a message bot is sending? HOT 1
- TravisCI on my discord bot using Discord.io HOT 2
- Purge Messages HOT 3
- moveUserTo not working
- Empty Member Object Properties HOT 3
- get all serverids the bot is connected to? HOT 1
- Getting all the Channels (including Direct Message Channels) the Client is connected to HOT 2
- How to get userid from username HOT 3
- I cant start my bot HOT 4
- How to check if bot is streaming audio in a channel? HOT 1
- TypeError: Cannot read property '18647709XXXXXXX' of undefined HOT 3
- Audio playback doesn't work HOT 1
- Is it possible to upload a file directly via buffer? HOT 2
- High-severity security alert in dependency: ws
- adding welcome message to specific channel HOT 2
- node bot.js not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord.io.