Open rawatnaresh opened 3 years ago
I can initialize the default device by passing deviceId: -1 but there is no way to know which of the devices are defaults.
deviceId: -1
Use case:
channelCount
2
but my External Microphone has channel count 1
1
[ { id: 0, name: 'External Microphone', maxInputChannels: 1, maxOutputChannels: 0, defaultSampleRate: 48000, defaultLowInputLatency: 0, defaultLowOutputLatency: 0, defaultHighInputLatency: 0, defaultHighOutputLatency: 0, hostAPIName: 'Core Audio' }, ...
with this, I can know the channelCount before initializing the instance
var portAudio = require('naudiodon'); console.log(portAudio.getDefaultDevices());
An example of the output is:
{ defaultInputDevice: { id: 0, name: 'Built-in Microphone', maxInputChannels: 2, maxOutputChannels: 0, defaultSampleRate: 44100, defaultLowInputLatency: 0, defaultLowOutputLatency: 0, defaultHighInputLatency: 0, defaultHighOutputLatency: 0, hostAPIName: 'Core Audio' }, defaultOutputDevice: { id: 1, name: 'Built-in Output', maxInputChannels: 0, maxOutputChannels: 2, defaultSampleRate: 44100, defaultLowInputLatency: 0, defaultLowOutputLatency: 0, defaultHighInputLatency: 0, defaultHighOutputLatency: 0, hostAPIName: 'Core Audio' } }
I can initialize the default device by passing
deviceId: -1
but there is no way to know which of the devices are defaults.Use case:
channelCount
of some of the defaultDevice is 1, then the app will crash because by defaultchannelCount
is being set as2
but my External Microphone has channel count
1
with this, I can know the
channelCount
before initializing the instanceEg:
An example of the output is: