Minim is set up in such a way that actual functionality (that is, implemented code) that is common between the classes that you will routinely use is placed in two base classes:
AudioSource. Whereas expected functionality is defined in four
interface in Java is defined like a class but contains only function definitions. That is, it defines an expected set of functionality without actually implementing any of it (see: Interfaces and Inheritance).
In JavaSound, when audio is transmitted from the system to your application or from your application to the system, it passes through a
Line, which is an
interface defined in the JavaSound API. A line can have controls such as pan, volume, and balance. These controls can be manipulated to change the audio as it passes through the line on its way to your application or to the speakers. Access to these controls is provided by the base class
AudioSource derive from
Controller and therefore inherit the functionality it provides. This functionality will be discussed in the next section.
AudioSource defines three
mix. These three sample buffers (a sample buffer is just a
float array) will contain the left channel, the right channel and the mix of the left and right channels, respectively. They are continually updated as audio is either received from the system, read from a file, or generated by an
AudioBuffer will be discussed in more depth later, the thing to know for now is that
AudioSample all derive from
AudioSource, which means that they inherit these buffers as data members, which means they all provide access to samples.
AudioSource also implements two of the four
Effectable. Not surprisingly, it is able to implement these two
interfaces because it has access to samples. As a result, the same four classes mentioned above that derive from
AudioSource are also
Effectable. This fact will be reiterated in the sections for those classes.
Finally, because inheritance of methods cascades all the way down the class hierarchy, the four classes that inherit from
AudioSource also inherit from
Controller. Think of it this way, for example:
AudioPlayer is an
AudioSource and is a
Controller. Therefore, everything you can do with an
AudioSource or a
Controller you can do with an