dimanche 2 octobre 2016

Most efficient way to write a buffer

I have to write an audio buffer that is filled/read progressively.

For now i'm using

m_outputBuffer.erase(
            m_outputBuffer.begin(),
            m_outputBuffer.begin()+read_samples);

when read_samples samples have been read from the buffer (I have to clear it to free RAM). But I know erase() is very expensive so what alternative do I have, considering I basically only have to move the pointer to the first element of my buffer and free the beginning ?

Aucun commentaire:

Enregistrer un commentaire