Git Product home page Git Product logo

Comments (7)

Adryd avatar Adryd commented on May 20, 2024

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.

hugmanrique avatar hugmanrique commented on May 20, 2024

This should be added to this line (Edit: outdated)

from discord.io.

RaidAndFade avatar RaidAndFade commented on May 20, 2024

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.

ZatsuneNoMokou avatar ZatsuneNoMokou commented on May 20, 2024

There's no other way to do it?

from discord.io.

t3kk avatar t3kk commented on May 20, 2024

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.

ZatsuneNoMokou avatar ZatsuneNoMokou commented on May 20, 2024

I don't really understand how it works? how am I supposed to do it with the youtube-dl nodejs module?

from discord.io.

t3kk avatar t3kk commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.