somewhere on that forum, exactly here there Jules said:
I’d suggest looping along the X axis and calling Graphics::drawVerticalLine to render each pixel-wide vertical section - that’s how the library draws audio thumbnails
He said that in the context of
Path and better CPU performance. But I wonder how to store those lines. When I have
Path I can keep my wave form in it and and draw it any time I want and any where on the screen I want. But when I use
paint(Graphics& g) to draw line from buffer data:
for(int i=1; i<bufferSize; i++) g.drawLine(axisX[i-1], audioBuffer[i-1], axisX[i], audioBuffer[i]);
But for the next audio buffer the one before will disappear.
That’s why I wonder how to store
Graphics to be able to draw wave form for whole song.
Whole song has for example about 3:00 minutes, it’s 180 seconds and in each second I have 44100 samples. It’s really a lot of data for
Path. But in the end it’s just simply curved line. So for the graphic point of view it’s not very complicated.
For example photo from telephone camera is much more complex. OK I know photo is rastered graph, and I probably need vector graph to be able to make some manipulation in the real time. But I don’t know how to deal with those issues.
Could anyone help? But please notice I don’t want to hard learn graphics theory. I just want to make some audio graph like waveform or freq analyser and probably will never do it again. I’ve heard about Open GL, but I am not sure what exactly it does and I am afraid to start with it, spend a lot of time for thing that in the future will be unnecessary for me.