kopia lustrzana https://gitlab.com/eliggett/wfview
More opus changes
rodzic
109bdb2812
commit
4ca21b84cb
|
@ -399,7 +399,7 @@ void audioHandler::getNextAudioChunk()
|
||||||
{
|
{
|
||||||
tempBuf.data.append(audioDevice->readAll());
|
tempBuf.data.append(audioDevice->readAll());
|
||||||
|
|
||||||
if (tempBuf.data.length() <= format.bytesForDuration(setup.blockSize * 2000)) {
|
if (tempBuf.data.length() <= getAudioSize(setup.latency,format)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,9 +407,9 @@ void audioHandler::getNextAudioChunk()
|
||||||
livePacket.time= QTime::currentTime();
|
livePacket.time= QTime::currentTime();
|
||||||
livePacket.sent = 0;
|
livePacket.sent = 0;
|
||||||
memcpy(&livePacket.guid, setup.guid, GUIDLEN);
|
memcpy(&livePacket.guid, setup.guid, GUIDLEN);
|
||||||
livePacket.data = tempBuf.data.left(format.bytesForDuration(setup.blockSize*2000));
|
livePacket.data = tempBuf.data.left(getAudioSize(setup.blockSize,format));
|
||||||
tempBuf.data.remove(0, format.bytesForDuration(setup.blockSize * 2000));
|
tempBuf.data.remove(0, getAudioSize(setup.blockSize,format));
|
||||||
//qDebug(logAudio()) << "Sending audio len" << livePacket.data.length() << "remaining" << tempBuf.data.length();
|
qInfo(logAudio()) << "Sending audio len" << livePacket.data.length() << "remaining" << tempBuf.data.length();
|
||||||
if (livePacket.data.length() > 0)
|
if (livePacket.data.length() > 0)
|
||||||
{
|
{
|
||||||
Eigen::VectorXf samplesF;
|
Eigen::VectorXf samplesF;
|
||||||
|
|
|
@ -153,7 +153,7 @@ static inline qint64 getAudioSize(qint64 timeInMs, const QAudioFormat& format)
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(1000) * timeInMs));
|
qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(1000) * timeInMs));
|
||||||
#else
|
#else
|
||||||
qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(10000) * timeInMs));
|
qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(1000) * timeInMs));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue