javax.sound.sampled
Class DataLine.Info

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.sound.sampled.Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info 
      extended by javax.sound.sampled.DataLine.Info
Enclosing interface:
DataLine sample code for javax.sound.sampled.DataLine definition code for javax.sound.sampled.DataLine

public static class DataLine.Info
extends Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.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 SourceDataLine sample code for javax.sound.sampled.SourceDataLine definition code for javax.sound.sampled.SourceDataLine , TargetDataLine sample code for javax.sound.sampled.TargetDataLine definition code for javax.sound.sampled.TargetDataLine , and Clip sample code for javax.sound.sampled.Clip definition code for javax.sound.sampled.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 Mixer.getLine(Line.Info) sample code for javax.sound.sampled.Mixer.getLine(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.Mixer.getLine(javax.sound.sampled.Line.Info) .

Since:
1.3
See Also:
Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info

Constructor Summary
DataLine.Info sample code for javax.sound.sampled.DataLine.Info.DataLine.Info(java.lang.Class, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.DataLine.Info.DataLine.Info(java.lang.Class, javax.sound.sampled.AudioFormat) (Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass, AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  format)
          Constructs a data line's info object from the specified information, which includes a single audio format.
DataLine.Info sample code for javax.sound.sampled.DataLine.Info.DataLine.Info(java.lang.Class, javax.sound.sampled.AudioFormat[], int, int) definition code for javax.sound.sampled.DataLine.Info.DataLine.Info(java.lang.Class, javax.sound.sampled.AudioFormat[], int, int) (Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass, AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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.
DataLine.Info sample code for javax.sound.sampled.DataLine.Info.DataLine.Info(java.lang.Class, javax.sound.sampled.AudioFormat, int) definition code for javax.sound.sampled.DataLine.Info.DataLine.Info(java.lang.Class, javax.sound.sampled.AudioFormat, int) (Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass, AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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.
 
Method Summary
 AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat [] getFormats sample code for javax.sound.sampled.DataLine.Info.getFormats() definition code for javax.sound.sampled.DataLine.Info.getFormats() ()
          Obtains a set of audio formats supported by the data line.
 int getMaxBufferSize sample code for javax.sound.sampled.DataLine.Info.getMaxBufferSize() definition code for javax.sound.sampled.DataLine.Info.getMaxBufferSize() ()
          Obtains the maximum buffer size supported by the data line.
 int getMinBufferSize sample code for javax.sound.sampled.DataLine.Info.getMinBufferSize() definition code for javax.sound.sampled.DataLine.Info.getMinBufferSize() ()
          Obtains the minimum buffer size supported by the data line.
 boolean isFormatSupported sample code for javax.sound.sampled.DataLine.Info.isFormatSupported(javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.DataLine.Info.isFormatSupported(javax.sound.sampled.AudioFormat) (AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.AudioFormat  format)
          Indicates whether this data line supports a particular audio format.
 boolean matches sample code for javax.sound.sampled.DataLine.Info.matches(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.DataLine.Info.matches(javax.sound.sampled.Line.Info) (Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info  info)
          Determines whether the specified info object matches this one.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.sound.sampled.DataLine.Info.toString() definition code for javax.sound.sampled.DataLine.Info.toString() ()
          Obtains a textual description of the data line info.
 
Methods inherited from class javax.sound.sampled.Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info
getLineClass sample code for javax.sound.sampled.Line.Info.getLineClass() definition code for javax.sound.sampled.Line.Info.getLineClass()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DataLine.Info sample code for javax.sound.sampled.DataLine.Info(java.lang.Class<?>, javax.sound.sampled.AudioFormat[], int, int) definition code for javax.sound.sampled.DataLine.Info(java.lang.Class<?>, javax.sound.sampled.AudioFormat[], int, int)

public DataLine.Info(Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass,
                     AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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

DataLine.Info sample code for javax.sound.sampled.DataLine.Info(java.lang.Class<?>, javax.sound.sampled.AudioFormat, int) definition code for javax.sound.sampled.DataLine.Info(java.lang.Class<?>, javax.sound.sampled.AudioFormat, int)

public DataLine.Info(Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass,
                     AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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 sample code for javax.sound.sampled.DataLine.Info(java.lang.Class<?>, javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.DataLine.Info(java.lang.Class<?>, javax.sound.sampled.AudioFormat)

public DataLine.Info(Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass,
                     AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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
Method Detail

getFormats sample code for javax.sound.sampled.DataLine.Info.getFormats() definition code for javax.sound.sampled.DataLine.Info.getFormats()

public AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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 NOT_SPECIFIED sample code for javax.sound.sampled.AudioSystem.NOT_SPECIFIED definition code for javax.sound.sampled.AudioSystem.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.
See Also:
isFormatSupported(AudioFormat) sample code for javax.sound.sampled.DataLine.Info.isFormatSupported(javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.DataLine.Info.isFormatSupported(javax.sound.sampled.AudioFormat)

isFormatSupported sample code for javax.sound.sampled.DataLine.Info.isFormatSupported(javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.DataLine.Info.isFormatSupported(javax.sound.sampled.AudioFormat)

public boolean isFormatSupported(AudioFormat sample code for javax.sound.sampled.AudioFormat definition code for javax.sound.sampled.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
See Also:
getFormats() sample code for javax.sound.sampled.DataLine.Info.getFormats() definition code for javax.sound.sampled.DataLine.Info.getFormats() , AudioFormat.matches(javax.sound.sampled.AudioFormat) sample code for javax.sound.sampled.AudioFormat.matches(javax.sound.sampled.AudioFormat) definition code for javax.sound.sampled.AudioFormat.matches(javax.sound.sampled.AudioFormat)

getMinBufferSize sample code for javax.sound.sampled.DataLine.Info.getMinBufferSize() definition code for javax.sound.sampled.DataLine.Info.getMinBufferSize()

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

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

getMaxBufferSize sample code for javax.sound.sampled.DataLine.Info.getMaxBufferSize() definition code for javax.sound.sampled.DataLine.Info.getMaxBufferSize()

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

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

matches sample code for javax.sound.sampled.DataLine.Info.matches(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.DataLine.Info.matches(javax.sound.sampled.Line.Info)

public boolean matches(Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.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 sample code for javax.sound.sampled.Line.Info.matches(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.Line.Info.matches(javax.sound.sampled.Line.Info) in class Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info
Parameters:
info - the info object which is being compared to this one
Returns:
true if this object matches the one specified, otherwise false.

toString sample code for javax.sound.sampled.DataLine.Info.toString() definition code for javax.sound.sampled.DataLine.Info.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Obtains a textual description of the data line info.

Overrides:
toString sample code for javax.sound.sampled.Line.Info.toString() definition code for javax.sound.sampled.Line.Info.toString() in class Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info
Returns:
a string description