This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.sound.sampled
class DataLine.Info

java.lang.Object extended by javax.sound.sampled.Line.Info extended by javax.sound.sampled.DataLine.Info
Enclosing class:
DataLine

public static class DataLine.Info
extends Line.Info

Besides the class information inherited from its superclass, DataLine.Info provides additional information specific to data lines. This information includes:

Because a Line.Info knows the class of the line its describes, a DataLine.Info object can describe DataLine subinterfaces such as {@link SourceDataLine}, {@link TargetDataLine}, and {@link Clip}. You can query a mixer for lines of any of these types, passing an appropriate instance of DataLine.Info as the argument to a method such as {@link Mixer#getLine Mixer.getLine(Line.Info)}.


Constructor Summary
DataLine.Info(Class lineClass, AudioFormat format)

          Constructs a data line's info object from the specified information, which includes a single audio format.
DataLine.Info(Class lineClass, AudioFormat format, int bufferSize)

          Constructs a data line's info object from the specified information, which includes a single audio format and a desired buffer size.
DataLine.Info(Class lineClass, AudioFormat[] formats, int minBufferSize, int maxBufferSize)

          Constructs a data line's info object from the specified information, which includes a set of supported audio formats and a range for the buffer size.
 
Method Summary
 AudioFormat[]

          Obtains a set of audio formats supported by the data line.
 int

          Obtains the maximum buffer size supported by the data line.
 int

          Obtains the minimum buffer size supported by the data line.
 boolean

          Indicates whether this data line supports a particular audio format.
 boolean

          Determines whether the specified info object matches this one.
 String

          Obtains a textual description of the data line info.
 
Methods inherited from class javax.sound.sampled.Line.Info
getLineClass, matches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataLine.Info

public DataLine.Info(Class lineClass,
                     AudioFormat format)
Constructs a data line's info object from the specified information, which includes a single audio format. This constructor is typically used by an application to describe a desired line.

Parameters:
lineClass - the class of the data line described by the info object
format - desired format

DataLine.Info

public DataLine.Info(Class lineClass,
                     AudioFormat format,
                     int bufferSize)
Constructs a data line's info object from the specified information, which includes a single audio format and a desired buffer size. This constructor is typically used by an application to describe a desired line.

Parameters:
lineClass - the class of the data line described by the info object
format - desired format
bufferSize - desired buffer size in bytes

DataLine.Info

public DataLine.Info(Class lineClass,
                     AudioFormat[] formats,
                     int minBufferSize,
                     int maxBufferSize)
Constructs a data line's info object from the specified information, which includes a set of supported audio formats and a range for the buffer size. This constructor is typically used by mixer implementations when returning information about a supported line.

Parameters:
lineClass - the class of the data line described by the info object
formats - set of formats supported
minBufferSize - minimum buffer size supported by the data line, in bytes
maxBufferSize - maximum buffer size supported by the data line, in bytes
Method Detail

getFormats

public AudioFormat[] getFormats()
Obtains a set of audio formats supported by the data line. Note that isFormatSupported(AudioFormat) might return true for certain additional formats that are missing from the set returned by getFormats(). The reverse is not the case: isFormatSupported(AudioFormat) is guaranteed to return true for all formats returned by getFormats(). Some fields in the AudioFormat instances can be set to {@link javax.sound.sampled.AudioSystem#NOT_SPECIFIED NOT_SPECIFIED} if that field does not apply to the format, or if the format supports a wide range of values for that field. For example, a multi-channel device supporting up to 64 channels, could set the channel field in the AudioFormat instances returned by this method to NOT_SPECIFIED.

Returns:
a set of supported audio formats.

getMaxBufferSize

public int getMaxBufferSize()
Obtains the maximum buffer size supported by the data line.

Returns:
maximum buffer size in bytes, or AudioSystem.NOT_SPECIFIED

getMinBufferSize

public int getMinBufferSize()
Obtains the minimum buffer size supported by the data line.

Returns:
minimum buffer size in bytes, or AudioSystem.NOT_SPECIFIED

isFormatSupported

public boolean isFormatSupported(AudioFormat format)
Indicates whether this data line supports a particular audio format. The default implementation of this method simply returns true if the specified format matches any of the supported formats.

Parameters:
format - the audio format for which support is queried.
Returns:
true if the format is supported, otherwise false

matches

public boolean matches(Line.Info info)
Determines whether the specified info object matches this one. To match, the superclass match requirements must be met. In addition, this object's minimum buffer size must be at least as large as that of the object specified, its maximum buffer size must be at most as large as that of the object specified, and all of its formats must match formats supported by the object specified.

Overrides:
matches in class Line.Info
Parameters:
info
Returns:
true if this object matches the one specified, otherwise false.

toString

public String toString()
Obtains a textual description of the data line info.

Overrides:
toString in class Line.Info
Returns:
a string description


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.