Skip to content

Commit 0594172

Browse files
authored
Update main.cpp
1 parent 6ae47ad commit 0594172

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/main.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ int main(int argc, char **argv) {
657657
unsigned int outputDeviceId = audio.getDefaultOutputDevice();
658658

659659
inputParams.deviceId = audio.getDefaultInputDevice();
660-
inputParams.nChannels = 1;
660+
inputParams.nChannels = 2;
661661
inputParams.firstChannel = 0;
662662

663663
outputParams.deviceId = audio.getDefaultOutputDevice();
@@ -669,9 +669,11 @@ int main(int argc, char **argv) {
669669

670670
std::vector<unsigned int> sampleRates = audio.getDeviceInfo(inputDeviceId).sampleRates;
671671
if (std::find(sampleRates.begin(), sampleRates.end(), sampleRate) == sampleRates.end()) {
672-
sampleRate = sampleRates[0]; // Choose the first supported sample rate
672+
sampleRate = 48000;
673+
if(std::find(sampleRates.begin(), sampleRates.end(), sampleRate) == sampleRates.end()) {
674+
sampleRate = sampleRates[0]; // Choose the first supported sample rate
675+
}
673676
}
674-
675677
#endif
676678

677679
cv::VideoWriter writer;

0 commit comments

Comments
 (0)