Fix codec selection issue in both QT5 and 6

half-duplex
Phil Taylor 2023-01-01 16:35:47 +00:00
rodzic 91ce6040e0
commit 32528a02b8
3 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -326,7 +326,7 @@ bool audioConverter::convert(audioPacket audio)
As we currently don't have a float based uLaw encoder, this must be done
after all other conversion has taken place.
*/
if (inCodec == PCMU)
if (outCodec == PCMU)
{
QByteArray outPacket((int)audio.data.length() / 2, (char)0xff);
qint16* in = (qint16*)audio.data.data();

Wyświetl plik

@ -69,7 +69,7 @@ audioHandler::~audioHandler()
", uLaw" << setup.ulaw;
inFormat = toQAudioFormat(setup.codec, setup.sampleRate);
codecType codec = LPCM;
codec = LPCM;
if (setup.codec == 0x01 || setup.codec == 0x20)
codec = PCMU;
else if (setup.codec == 0x40 || setup.codec == 0x40)
@ -80,7 +80,7 @@ audioHandler::~audioHandler()
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Preferred Format: SampleSize" << outFormat.sampleSize() << "Channel Count" << outFormat.channelCount() <<
"Sample Rate" << outFormat.sampleRate() << "Codec" << outFormat.codec() << "Sample Type" << outFormat.sampleType();
"Sample Rate" << outFormat.sampleRate() << "Codec" << codec << "Sample Type" << outFormat.sampleType();
#else
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Preferred Format: SampleFormat" << outFormat.sampleFormat() << "Channel Count" << outFormat.channelCount() <<
"Sample Rate" << outFormat.sampleRate();

Wyświetl plik

@ -138,6 +138,7 @@ private:
OpusEncoder* encoder = Q_NULLPTR;
OpusDecoder* decoder = Q_NULLPTR;
QTimer* underTimer;
codecType codec;
};