void AudioSource::processBufferDecoder() { QAudioBuffer buff = decoder->read(); qint64 val = this->pos(); this->seek(this->size()); this->write((const char*)buff.constData(),buff.byteCount()); this->seek(val); }
bool WaveFileWriter::write(const QAudioBuffer &buffer) { if (buffer.format() != m_format) return false; // buffer format has changed qint64 written = file.write((const char *)buffer.constData(), buffer.byteCount()); m_dataLength += written; return written == buffer.byteCount(); }