Ref T730, changes of RR/KB testing dual channels and WSAPI issues

This commit is contained in:
Klaus Basan
2019-09-23 17:29:18 +02:00
committed by Mat Sutcliffe
parent 11275d3560
commit 9bbb710823
2 changed files with 40 additions and 18 deletions

View File

@@ -61,7 +61,16 @@ namespace BlackCore
m_maxSampleOutput = 0;
}
memcpy(data, buffer.constData(), maxlen);
// if (maxlen > buffer.size()) { maxlen = buffer.size(); }
// memcpy(data, buffer.constData(), maxlen > buffer.size() ? buffer.size() : maxlen);
qint16 *p = reinterpret_cast<qint16 *>(data);
int index = 0;
for (int n = 0; n < count; n++)
{
p[index++] = buffer[n];
if (channelCount == 2) p[index++] = buffer[n];
}
return maxlen;
}
@@ -90,8 +99,15 @@ namespace BlackCore
if (!device.isFormatSupported(outputFormat))
{
qWarning() << "Default format not supported - trying to use nearest";
qWarning() << "Default OUTPUT format not supported - trying to use nearest";
outputFormat = device.nearestFormat(outputFormat);
qWarning() << "Default format not supported - trying to use nearest:";
qWarning() << "Sample rate: " << outputFormat.sampleRate();
qWarning() << "Sample size: " << outputFormat.sampleSize();
qWarning() << "Sample type: " << outputFormat.sampleType();
qWarning() << "Byte order: " << outputFormat.byteOrder();
qWarning() << "Codec: " << outputFormat.codec();
qWarning() << "Channel count: " << outputFormat.channelCount();
}
m_audioOutputCom1.reset(new QAudioOutput(device, outputFormat));