Giter VIP home page Giter VIP logo

audio-mixer's People

Contributors

connorchristie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

audio-mixer's Issues

100% cpu usage

Hi, i've been using audio-mixer in my recent project and noticed 100% audio usage.

The use case where i noticed this is :

  • Discord Bot 1 adds audio streams to the mixer
  • Discord Bot 2 is reading the mixer to output voice

This test case also has this problem :

  • Discord Bot 1 adds audio streams to the mixer
  • The mixer outputs the streams in a file

You could think that it would be caused by too many streams, but actually even this test case works:

  • Discord Bot 1 is able to add audio streams, but does not (mixer has no Input)
  • The mixer outpus the streams in a file
    -> 100% cpu usage for a while
    -> the file is empty

When using the profiler, i'm noticing 99% cpu usage for calls to epoll_pwait in c++ wrapper.
I'm guessing this has to do with the usage of ffmpeg ? Is mixer always encoding even when there is no input ? I hope you can help with this :)

Mixing process doesn't end/close stream

This probably isn't a bug, but I am not able to get this process to work. I'm trying to mix a variable number of pcm files into one output file from the command line. Here's the mixing stream code. Node does get to the end of this, but then just pauses and doesn't end the script/process. Am I missing a command to "finish" the process?

  const mixer = new AudioMixer.Mixer({
    channels: 1,
    bitDepth: 16,
    sampleRate: 16000,
  });

  for (const filename of inFilenames) {
    const fileStream = fs.createReadStream(filename);

    const input = mixer.input({
      channels: 1,
      volume: 75,
    });

    fileStream.pipe(input);
  }

  const write = fs.createWriteStream(outFilename);

  mixer.pipe(write);

Respect backpressure in inputs and mixer

Input just internally buffers its data as soon as it gets it. Mixer also calls this.push without checking the return value for backpressure.

Both of these would need to change to respect backpressure.

Volume of 0 is not working

Having a volume of 0 will set the volume of 100:

volume: args.volume || 100

I am working around it now by using

const VOLUME_ZERO = 0.0000001

Convert output data to web-audio playable data

Hello, I am struggling with a problem and would really like some help!

I have a Writable stream as destination and I gather the mixed data by implementing a custom _write() function.
My goal is to send this data to any connected client (browser based) and play them as audio using web-audio.

(The part where I send the data to the clients is working)

What I can't figure out is in what form to have the output data in order for them to be playable using web audio.

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.