SourceDataLine
,
and the latter, TargetDataLine
. Port
objects, too, are either source lines or target lines.
A mixer can accept prerecorded, loopable sound as input, by having
some of its source lines be instances of objects that implement the
Clip
interface.
Through methods of the Line
interface, which Mixer
extends,
a mixer might provide a set of controls that are global to the mixer. For example,
the mixer can have a master gain control. These global controls are distinct
from the controls belonging to each of the mixer's individual lines.
Some mixers, especially
those with internal digital mixing capabilities, may provide
additional capabilities by implementing the DataLine
interface.
A mixer can support synchronization of its lines. When one line in a synchronized group is started or stopped, the other lines in the group automatically start or stop simultaneously with the explicitly affected one.
update()
method is called with a LineEvent
object
that describes the change.CLOSE
event is dispatched
to the line's listeners.Line.Info
object.
If a DataLine
is requested, and info
is an instance of DataLine.Info
specifying at
least one fully qualified audio format, the last one
will be used as the default format of the returned
DataLine
.
Line.Info
object describing this
line.Line.Info
object. For example, if the info
object represents a speaker
port, and the mixer supports exactly one speaker port, this method
should return 1. If the info object represents a source data line
and the mixer supports the use of 32 source data lines simultaneously,
the return value should be 32.
If there is no limit, this function returns AudioSystem.NOT_SPECIFIED
.Line.Info
object.
Some lines may only be supported when this mixer is open.OPEN
event is dispatched
to the line's listeners.
Note that some lines, once closed, cannot be reopened. Attempts
to reopen such a line will always result in an LineUnavailableException
.
Some types of lines have configurable properties that may affect
resource allocation. For example, a DataLine
must
be opened with a particular format and buffer size. Such lines
should provide a mechanism for configuring these properties, such
as an additional open
method or methods which allow
an application to specify the desired settings.
This method takes no arguments, and opens the line with the current
settings. For SourceDataLine
and
TargetDataLine
objects, this means that the line is
opened with default settings. For a Clip
, however,
the buffer size is determined when data is loaded. Since this method does not
allow the application to specify any data to load, an IllegalArgumentException
is thrown. Therefore, you should instead use one of the open
methods
provided in the Clip
interface to load data into the Clip
.
For DataLine
's, if the DataLine.Info
object which was used to retrieve the line, specifies at least
one fully qualified audio format, the last one will be used
as the default format.
null
may be specified, in which case all currently synchronized lines that belong
to this mixer are unsynchronized.