How to determine sample rate of WASAPICapture.Device ?

Apr 27, 2016 at 5:22 PM
Edited Apr 27, 2016 at 9:32 PM
I need to determine the sample rate of a Windows Recording Device as it was set in Windows, before I use that device by creating a new CSCore.SoundIn.WasapiCapture device.

I have figured out that I can find, for example, the number of channels set in Windows for that device by using AudioMeterInformation.FromDevice(mic_in.Device).MeteringChannelCount.

But I am at a loss for how to similarly determine the sample rate for the device.

I need to know this value BEFORE I set my desired waveformat for this device.

I believe I need to do something like:

mic_in2_SampleRate = mic_in.Device.PropertyStore.GetValue(PKEY_AudioEngine_DeviceFormat);

but PKEY_AudioEngine_DeviceFormat does not appear to be exposed.

What is needed [and may be there but missed by me] is something like this:
<member name="F:NAudio.CoreAudioApi.PropertyKeys.PKEY_AudioEngine_DeviceFormat">
Thanks in advance!