PDA

View Full Version : QaudioOutput play buffer audio real time disconnect network ?



Thành Viên Mới
9th May 2011, 20:32
hi all, i am developing chat voice LAN QAudioOutput similar example: http://doc.qt.nokia.com/latest/multimedia-audiooutput-audiooutput-cpp.html


qint64 Generator::readData(char *data, qint64 len)
{
qint64 total = 0;
while (len - total > 0) {
const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total);
memcpy(data + total, m_buffer.constData() + m_pos, chunk);
m_pos = (m_pos + chunk) % m_buffer.size();
total += chunk;
}
return total;
}

, my problem is when network lag connect 2 client, when client cant recive data from other client, it will play again old data.

i want audio buffer only play data appended in m_buffer,

thanks and best regard

Thành Viên Mới
10th May 2011, 13:20
can you help me