i dont understand source code Play audio of Qt sample output:
qint64 Generator::readData(char *data, qint64 len)
{
qint64 total = 0;
while (len - total) {
const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total);
memcpy(data, 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) {
const qint64 chunk = qMin((m_buffer.size() - m_pos), len - total);
memcpy(data, 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
in source code: http://doc.qt.nokia.com/latest/multi...utput-cpp.html
can you explain for me ?
Bookmarks