Egged on by the Processing 1.0 team, I spent today putting together a new release of Minim, which had been languishing on my computer. The lion’s share of the work was simply updating the examples and then uploading them. I really need to automate that process, it’s a big pain. Still not done: updating the manual.
A very important change to be aware of if you are upgrading, is that the
Minim class is now instantiable. All of the
get methods have been changed to regular old member functions, rather than static on the class. The static
start(PApplet) method has been removed, you must now pass your sketch into the constructor, like so:
Minim minim = new Minim(this); AudioPlayer player = minim.loadFile("blah.wav");
A very cool addition is
AudioSample. The ability to read the ID3 tags from mp3 files was always there in the package I use for playing those, but I didn’t hook it up initially. Now all the tags you probably care about get stuffed into an
AudioMetaData object when you load a file. Check out the online example.
An interesting implementation change is that I’ve broken out the Javasound specific code from the generic audio abstraction layer code. This means that there is now a package called ddf.minim.spi, which defines a bunch of interfaces that Minim uses to load files and acquire inputs and outputs. The key interface is
MinimServiceProvider, which looks a lot like a slimmed down version of Minim’s interface. It is now possible for you implement
MinimServiceProvider and then pass an instance of your implementation into the Minim constructor. Minim will use your implementation for all audio resource acquisition. This means that the default implementation, which uses Javasound, does exactly that and lives in jsminim.jar, which is included with the distro. One of the reasons that I did this was so that I could easily write an implementation of Minim that uses an FModEx Java binding. Work has begun on that, but it is not yet finished. Still, something to look forward to!