Спасибо. вопрос решен.
QByteArray buffer;
if (dataBuffer)
{
buffer.append((char*)dataBuffer, length);
}
QFile bufferFile;
bufferFile.setFileName(cacheDir + externAid + ".mp3");
bufferFile.open(QFile::WriteOnly);
bufferFile.write(buffer, buffer.size());
bufferFile.flush();
bufferFile.close();