1
votes

I'm developing a Windows audio application, and am using an MMDeviceEnumerator to whip through all of the available audio interfaces. This trickles down to getting an MMDevice that gives me some information about the device itself.

I'm wanting to get the total number of channels that the device provides. Currently, I'm using the property store to return the current WAV format, but this returns the format that Windows has specified for 'shared' mode. Using a Focusrite 18i8, Windows indicates that this device has 2 channels, which is exactly what is specified in the 'Default Format' of the device advanced settings. Windows itself won't let me specify anything other than 2 input channels in the Default Format.

Problem is, this device has 18 input channels, and I want to open it in exclusive mode using Wasapi and gain access to all of the channels. I'm not sure how to find out how many 'real' channels the audio device actually has.

Can this be found from MMDevice?

1
I'm already using PKEY_AudioEngine_DeviceFormat, but it only returns the shared-mode format like you said. I need to determine how many channels this device has in exclusive mode. I hate to think that I have to keep calling IsFormatSupported with ever-increasing channel counts until it fails. Some cards like the Dante Virtual SoundCard can have up to 256 channels!Chuck D
I am not sure if it can help, but here are two apps [1, 2] that list available properties. Maybe you can get what you want from PKEY_AudioEngine_OEMFormat.Roman R.
You need to configure the audio device first. See windows.microsoft.com/en-us/windows-vista/…Florian

1 Answers

0
votes

By using CSCore, you can get this information by using the AudioMeterInformation Class.

Here is an example:

mic_in.Device = micdevices[waveInIndex];

int  mic_in_chanNo = AudioMeterInformation.FromDevice(mic_in.Device).MeteringChannelCount;