hi all, i am developing chat voice LAN QAudioOutput similar example: http://doc.qt.nokia.com/latest/multi...utput-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;
}
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;
}
To copy to clipboard, switch view to plain text mode
, 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
Bookmarks