I’m writing a small audio program in c++ and would like to be able to display the waveform of a whole track on a timeline. Currently I am creating a stream for each track and using readData to read a group of samples into a buffer at a time, where I get the min and max values to display for a pixels width on the timeline.
The problem is when using readData on large MP3 files It’s taking longer than I would like to generate the waveform. On a 3 minuite track it takes around 3 seconds on a fast pc. I realise that there are a lot of samples to be read – 44000 per second per channel – but is there anyway to improve this performance? I’ve messed around with different buffer sizes for readData and it doesn’t seem to have much effect. Is there any other way to do this?
Any help is appreciated,
- GregC asked 7 years ago
- You must login to post comments