AudioDataConverters::convertInt16LEToFloat? (Assuming the arch is LE) Pretty simple, just pass it two pointers to preallocated blocks and the number of samples. Personally I would use HeapBlocks as you can just provide each one with a number of samples, you don’t have to fiddle around with sizeof operators.
You can then create an AudioSampleBuffer from this block using the relevant constructor. You’ll probably need an intermediate array to hold the pointers to the start of each channel something like:
channelData = convertedLeft;
channelData = convertedRight;
channelData = nullptr;
You could do this with a member HeapBlock if you need to keep the samples around for reasons such as adding them on a background thread but make sure the HeapBlock’s that contain the actual sample data are also members.
Once the samples are in an AudioSampleBuffer you can just add them to the thumbnail using AudioThimbnail::addBlock(), make sure to call reset() first though.
The other way to do it would be to write the AudioSampleBuffer to a WavAudioFormat and then use that as the InputSource to the AudioThumbnail.
Another way would be to use my AudioSampleBufferAudioFormat to be able to read directly from the AudioSampleBuffer into the AudioThumbnail::setSource() method.
Lots of options and each has their benefits.