kopia lustrzana https://gitlab.com/eliggett/wfview
Found bug in server audio
rodzic
3815ac67e7
commit
3296e16195
|
@ -399,19 +399,16 @@ void audioHandler::getNextAudioChunk()
|
|||
{
|
||||
tempBuf.data.append(audioDevice->readAll());
|
||||
|
||||
if (tempBuf.data.length() < getAudioSize(setup.blockSize,format)) {
|
||||
if (tempBuf.data.length() < getAudioSize(setup.blockSize,format)*10) {
|
||||
return;
|
||||
}
|
||||
else if (tempBuf.data.length() > getAudioSize(setup.latency, format)) {
|
||||
tempBuf.data.clear();
|
||||
}
|
||||
|
||||
audioPacket livePacket;
|
||||
livePacket.time= QTime::currentTime();
|
||||
livePacket.sent = 0;
|
||||
memcpy(&livePacket.guid, setup.guid, GUIDLEN);
|
||||
livePacket.data = tempBuf.data.mid(0,getAudioSize(setup.blockSize,format));
|
||||
tempBuf.data.remove(0, getAudioSize(setup.blockSize,format));
|
||||
livePacket.data = tempBuf.data.mid(0,getAudioSize(setup.blockSize,format)*10);
|
||||
tempBuf.data.remove(0, getAudioSize(setup.blockSize,format)*10);
|
||||
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(1000) * timeInMs));
|
||||
qint64 value = qint64(qCeil(format.channelCount() * (format.sampleSize() / 8) * format.sampleRate() / qreal(10000) * timeInMs));
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -1626,7 +1626,7 @@ void udpServer::receiveAudioData(const audioPacket& d)
|
|||
p.sendseq = (quint16)qToBigEndian((quint16)client->sendAudioSeq); // THIS IS BIG ENDIAN!
|
||||
p.seq = client->txSeq;
|
||||
QByteArray t = QByteArray::fromRawData((const char*)p.packet, sizeof(p));
|
||||
t.append(d.data);
|
||||
t.append(partial);
|
||||
|
||||
SEQBUFENTRY s;
|
||||
s.seqNum = p.seq;
|
||||
|
|
Ładowanie…
Reference in New Issue