File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -657,7 +657,7 @@ int main(int argc, char **argv) {
657
657
unsigned int outputDeviceId = audio.getDefaultOutputDevice ();
658
658
659
659
inputParams.deviceId = audio.getDefaultInputDevice ();
660
- inputParams.nChannels = 1 ;
660
+ inputParams.nChannels = 2 ;
661
661
inputParams.firstChannel = 0 ;
662
662
663
663
outputParams.deviceId = audio.getDefaultOutputDevice ();
@@ -669,9 +669,11 @@ int main(int argc, char **argv) {
669
669
670
670
std::vector<unsigned int > sampleRates = audio.getDeviceInfo (inputDeviceId).sampleRates ;
671
671
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
+ }
673
676
}
674
-
675
677
#endif
676
678
677
679
cv::VideoWriter writer;
You can’t perform that action at this time.
0 commit comments