Flowr-es / node-microphone

MIT License
27 stars 9 forks source link

Is it possible to use multiple audio devices? #14

Closed EsteveSegura closed 4 years ago

EsteveSegura commented 4 years ago

I am trying to detect the sound of multiple audio inputs ... Is this possible?

Flowr-es commented 4 years ago

You should be able to open for each audio input an stream. However I have not tested it...

I would do something like this: const Mic = require('node-microphone'); const SoundDetector = require('fromSomewhere'); [ 'audioDevice1', 'audioDevice2' ].forEach( device => { let mic = new Mic( { device }); let micStream = mic.startRecording(); let soundDetector = new SoundDetector(); micStream.pipe( soundDetector ); });