Minim index
Name Controller
Examples
None available
Description Controller is the base class of all Minim classes that deal with audio I/O. It provides control over the underlying DataLine, which is a low-level JavaSound class that talks directly to the audio hardware of the computer. This means that you can make changes to the audio without having to manipulate the samples directly. The downside to this is that when outputting sound to the system (such as with an AudioOutput), these changes will not be present in the samples made available to your program.

The {@link #volume()}, {@link #gain()}, {@link #pan()}, and {@link #balance()} methods return objects of type FloatControl, which is a class defined by the JavaSound API. A FloatControl represents a control of a line that holds a float value. This value has an associated maximum and minimum value (such as between -1 and 1 for pan), and also a unit type (such as dB for gain). You should refer to the FloatControl Javadoc for the full description of the methods available.

Not all controls are available on all objects. Before calling the methods mentioned above, you should call {@link #hasControl(javax.sound.sampled.Control.Type)} with the control type you want to use. Alternatively, you can use the get and set methods, which will simply do nothing if the control you are trying to manipulate is not available.

Constructors
Controller(cntrls);
Parameters
cntrls   an array of Controls that this Controller will manipulate
Fields
BALANCE   The balance control type.

GAIN   The gain control type.

MUTE   The mute control type.

PAN   The pan control type.

SAMPLE_RATE   The sample rate control type.

VOLUME   The volume control type.

Methods
balance ( )   Gets the balance control for the Line, if it exists. You should check for the availability of a balance control by using {@link #hasControl(javax.sound.sampled.Control.Type)} before calling this method.

gain ( )   Gets the gain control for the Line, if it exists. You should check for the availability of a gain control by using {@link #hasControl(javax.sound.sampled.Control.Type)} before calling this method.

getBalance ( )   Returns the current balance of the line. This will be in the range [-1, 1]. If a balance control is not available, this will do nothing.

getControls ( )   Returns an array of all the available Controls for the DataLine being controlled. You can use this if you want to access the controls directly, rather than using the convenience methods provided by this class.

getGain ( )   Returns the current gain. If a gain control is not available, this returns 0. Note that the gain is not the same thing as the level() of an AudioBuffer!

getPan ( )   Returns the current pan value. This will be in the range [-1, 1]. If the pan control is not available

getVolume ( )   Returns the current volume. If a volume control is not available, this returns 0. Note that the volume is not the same thing as the level() of an AudioBuffer!

hasControl ( )   Returns whether or not the particular control type is supported by the Line being controlled.

isMuted ( )   Returns true if the line is muted.

mute ( )   Mutes the line.

pan ( )   Gets the pan control for the Line, if it exists. You should check for the availability of a pan control by using {@link #hasControl(javax.sound.sampled.Control.Type)} before calling this method.

printControls ( )   Prints the available controls and their ranges to the console. Not all lines have all of the controls available on them so this is a way to find out what is available.

setBalance ( )   Sets the balance of the line to v. The provided value should be in the range [-1, 1]. If a balance control is not available, this will do nothing.

setGain ( )   Sets the gain to v. If a gain control is not available, this does nothing.

setPan ( )   Sets the pan of the line to v. The provided value should be in the range [-1, 1].

setVolume ( )   Sets the volume to v. If a volume control is not available, this does nothing.

shiftBalance ( )   Shifts the value of the balance from from to to in the space of millis milliseconds.

shiftGain ( )   Shifts the value of the gain from from to to in the space of millis

shiftPan ( )   Shifts the value of the pan from from to to in the space of millis milliseconds.

shiftVolume ( )   Shifts the value of the volume from from to to in the space of millis milliseconds.

unmute ( )   Unmutes the line.

volume ( )   Gets the volume control for the Line, if it exists. You should check for the availability of a volume control by using {@link #hasControl(javax.sound.sampled.Control.Type)} before calling this method.

Usage Web & Application
Related