Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to setup desired sampleRate
Browse files Browse the repository at this point in the history
wkpark committed Jul 26, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0d42110 commit f3381a7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/device.cpp
Original file line number Diff line number Diff line change
@@ -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<WAVEFORMATEX *>(
audioMediaType->pbFormat);
// set the desired sampleRate
wfex->nSamplesPerSec = config.sampleRate;
Debug(L"\tdesired sampleRate = %d", config.sampleRate);
}
}

if (!!pinConfig) {

0 comments on commit f3381a7

Please sign in to comment.