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());
|
||||
|
||||
if (tempBuf.data.length() <= format.bytesForDuration(setup.blockSize * 2000)) {
|
||||
if (tempBuf.data.length() <= getAudioSize(setup.latency,format)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -407,9 +407,9 @@ void audioHandler::getNextAudioChunk()
|
|||
livePacket.time= QTime::currentTime();
|
||||
livePacket.sent = 0;
|
||||
memcpy(&livePacket.guid, setup.guid, GUIDLEN);
|
||||
livePacket.data = tempBuf.data.left(format.bytesForDuration(setup.blockSize*2000));
|
||||
tempBuf.data.remove(0, format.bytesForDuration(setup.blockSize * 2000));
|
||||
//qDebug(logAudio()) << "Sending audio len" << livePacket.data.length() << "remaining" << tempBuf.data.length();
|
||||
livePacket.data = tempBuf.data.left(getAudioSize(setup.blockSize,format));
|
||||
tempBuf.data.remove(0, getAudioSize(setup.blockSize,format));
|
||||
qInfo(logAudio()) << "Sending audio len" << livePacket.data.length() << "remaining" << tempBuf.data.length();
|
||||
if (livePacket.data.length() > 0)
|
||||
{
|
||||
Eigen::VectorXf samplesF;
|
||||
|
|
|
@ -153,7 +153,7 @@ static inline qint64 getAudioSize(qint64 timeInMs, const QAudioFormat& format)
|
|||
#ifdef Q_OS_LINUX
|
||||
qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(1000) * timeInMs));
|
||||
#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
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue