how to efficiently draw an audio waveform

94 views Asked by At

I am writing a waveform editor but am stuck at what seems a simple problem as for efficiently drawing even very long recordings. It is my understanding/intuition that for every column one pixel wide in the display I must compute the min and the max amplitude of the corresponding block of samples (and then draw a vertical line between them) But this translates to having to scan the whole recording, which can even be many MB long, at every zoom in or out operation, which is surely not very efficient, and can even lead to hiccups on slow machines or with very long recordings. I am sure that some trick exists and is commonly used to speed up this task but I have no idea how to do it... can you point me on some link explaining the tricks if any ? Or explain the tricks directly ? I could not find any...

0

There are 0 answers