Draw an AudioThumbnail from binary data


quick question: I’m trying to render wav files which are bundled as binary data. As far as I can tell, the interface for AudioThumbnail only provides setReader & setSource methods, which only work on files. I’m probably missing something really obvious. How do I connect a MemoryInputStream to a AudioThumbnail?



You should be able to call loadFrom with your AudioThumbnail instance.

But the docs say: This is not an audio file stream! It takes a stream of thumbnail data that would previously have been created by the saveTo() method.

Sure, so you can store the data that was generated by saveTo into a file which can be embedded.

Could you just use an inmemory Reader?