Update audiohandler.cpp

merge-requests/5/head
Phil Taylor 2021-06-02 12:35:10 +01:00
rodzic 53ab05bfef
commit 69a34f1c00
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -72,10 +72,8 @@ bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16
if (info.probed) if (info.probed)
{ {
// Per channel chunk size. // if "preferred" sample rate is 44100, try 48K instead
aParams.nChannels = 2; // Internally this is always 2 channels for TX and RX. if (info.preferredSampleRate == (unsigned int)44100) {
if (info.preferredSampleRate == 44100) {
qDebug(logAudio()) << "Preferred sample rate 44100, trying 48000"; qDebug(logAudio()) << "Preferred sample rate 44100, trying 48000";
this->nativeSampleRate = 48000; this->nativeSampleRate = 48000;
} }
@ -83,6 +81,7 @@ bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16
this->nativeSampleRate = info.preferredSampleRate; this->nativeSampleRate = info.preferredSampleRate;
} }
// Per channel chunk size.
this->chunkSize = (this->nativeSampleRate / 50); this->chunkSize = (this->nativeSampleRate / 50);
qInfo(logAudio()) << (isInput ? "Input" : "Output") << QString::fromStdString(info.name) << "(" << aParams.deviceId << ") successfully probed"; qInfo(logAudio()) << (isInput ? "Input" : "Output") << QString::fromStdString(info.name) << "(" << aParams.deviceId << ") successfully probed";