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_)
numChannels = newNumChannels; sampleRate = newSampleRate; totalSamples = totalSamples_; createChannels (1 + (int) (totalSamples / samplesPerThumbSample));
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)