(both of these screenshots use an AudioThumbnail initialised with sourceSamplesPerThumbnailSample = 512)
I am having a few problems in getting my audio plugin to display the waveform correctly. The upper of the two strips displays what happens when I set the AudioThumbnail up using:
The lower strip is what happens when I add a sample using:
thumbnail.reset(numThumbnailChannels, sampleRate, numSamples);
thumbnail.addBlock(0, testBuffer, 0, numSamples);
Basically when using FileInputSource method, the sourceSamplesPerThumbnailSample variable seems to adjust based on the sample length (shorter samples are drawn with higher resolution). When using the addBlock method, it seems fixed by the value given in the constructor. This means that while sourceSamplesPerThumbnailSample = 512 may display longer samples fine, shorter ones (such as that in the screenshot) remain blocky.
So my question is: is there a way to have a sensible resolution provided by the addBlock method? And if not, is there any way to change sourceSamplesPerThumbnailSample on the fly? Or am I missing something really obvious?
Any help greatly appreciated!