From eddc5d42ba7e237f2ca87f02d7c5cb363b067b20 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 1 Aug 2021 18:34:32 +0100 Subject: [PATCH] Fix broken 8bit audio --- audiohandler.cpp | 4 ++-- audiohandler.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/audiohandler.cpp b/audiohandler.cpp index 9b99d0a..3bd256f 100644 --- a/audiohandler.cpp +++ b/audiohandler.cpp @@ -470,7 +470,7 @@ void audioHandler::incomingAudio(audioPacket inPacket) { for (int g = setup.radioChan; g <= devChannels; g++) { - if (isUlaw) + if (setup.ulaw) *out++ = ulaw_decode[(quint8)inPacket.data[f]] * this->volume; else *out++ = (qint16)(((quint8)inPacket.data[f] << 8) - 32640 * this->volume); @@ -620,7 +620,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret) for (int f = 0; f < outPacket.length(); f++) { quint8 outdata = 0; - if (isUlaw) { + if (setup.ulaw) { qint16 enc = qFromLittleEndian(in + f); if (enc >= 0) outdata = ulaw_encode[enc]; diff --git a/audiohandler.h b/audiohandler.h index 4e7a3f2..8fc730d 100644 --- a/audiohandler.h +++ b/audiohandler.h @@ -155,9 +155,7 @@ private: #endif SpeexResamplerState* resampler = Q_NULLPTR; - bool isUlaw; quint16 audioLatency; - bool isInput; // Used to determine whether input or output audio unsigned int chunkSize; bool chunkAvailable;