diff --git a/source/device.cpp b/source/device.cpp index 84c9eb3..4d9155c 100644 --- a/source/device.cpp +++ b/source/device.cpp @@ -468,6 +468,15 @@ bool HDevice::SetupAudioCapture(IBaseFilter *filter, AudioConfig &config) Error(L"Could not get closest audio media type"); return false; } + } else { + // useDefaultConfig case + if (config.sampleRate != 0) { + WAVEFORMATEX *wfex = reinterpret_cast( + audioMediaType->pbFormat); + // set the desired sampleRate + wfex->nSamplesPerSec = config.sampleRate; + Debug(L"\tdesired sampleRate = %d", config.sampleRate); + } } if (!!pinConfig) {