I have a theory that Iām the only one yet to use the thumbnail in what I call passive mode, when you call addBlock yourselfā¦
because it seems that you need a little more to make it actually work, specifically:
[code]void AudioThumbnail::reset (int newNumChannels, double newSampleRate, int totalSamples_)
{
clear();
numChannels = newNumChannels;
sampleRate = newSampleRate;
totalSamples = totalSamples_;
createChannels (1 + (int) (totalSamples / samplesPerThumbSample));
}[/code]
I havenāt updated Juce in a week or two, if this is a known issue.
Iām also having some issue with writing the thumbnails - they are huge (50MB for a song-length stereo track at 512 samples/sample) and when I read them back, I donāt get an error - but I donāt get a thumbnail displayed either! BUT I havenāt debugged this it and statistically itās probably my code.
(First edit: actually, reading the thumbnail from my disk cache works fine - it just takes a long time because itās so large! Now to figure out why itās so large - perhaps my samples per sample rate is much too lowā¦)
(Second edit: I corrected my code above to divide by āsamplesPerThumbSampleā in createChannels() so now my samples are 512 times smaller. :-D)