javax.sound.sampled

Class DataLine.Info

public static class DataLine.Info extends Line.Info

This class extends Line.Info with information specific to DataLine. In particular it adds information about buffer sizes, and about supported audio formats.

Since: 1.3

Constructor Summary
Info(Class<?> klass, AudioFormat fmt)
Create a new Info given the line's class and a supported audio format.
Info(Class<?> klass, AudioFormat[] fmts, int minSize, int maxSize)
Create a new Info given the line's class, the supported audio formats, the minimum buffer size, and the maximum buffer size.
Info(Class<?> klass, AudioFormat fmt, int size)
Create a new Info given the line's class, a supported audio format, and a buffer size.
Method Summary
AudioFormat[]getFormats()
Return the supported audio formats.
intgetMaxBufferSize()
Return the maximum buffer size.
intgetMinBufferSize()
Return the minimum buffer size.
booleanisFormatSupported(AudioFormat fmt)
Return true if the indicated audio format is supported by this Info, false otherwise.
booleanmatches(Line.Info o)
Return true if this Info matches another Info object.
StringtoString()
Return a description of this Info object.

Constructor Detail

Info

public Info(Class<?> klass, AudioFormat fmt)
Create a new Info given the line's class and a supported audio format. The buffer sizes default to AudioSystem.NOT_SPECIFIED.

Parameters: klass the class of the line fmt the supported format

Info

public Info(Class<?> klass, AudioFormat[] fmts, int minSize, int maxSize)
Create a new Info given the line's class, the supported audio formats, the minimum buffer size, and the maximum buffer size.

Parameters: klass the class of the linee fmts the supported audio formats minSize the minimum buffer size maxSize the maximum buffer size

Info

public Info(Class<?> klass, AudioFormat fmt, int size)
Create a new Info given the line's class, a supported audio format, and a buffer size. Both the minimum and maximum sizes are set from this size.

Parameters: klass the class of the line fmt the supported format size the buffer size

Method Detail

getFormats

public AudioFormat[] getFormats()
Return the supported audio formats.

getMaxBufferSize

public int getMaxBufferSize()
Return the maximum buffer size.

getMinBufferSize

public int getMinBufferSize()
Return the minimum buffer size.

isFormatSupported

public boolean isFormatSupported(AudioFormat fmt)
Return true if the indicated audio format is supported by this Info, false otherwise.

Parameters: fmt the audio format

Returns: true if the format is supported

matches

public boolean matches(Line.Info o)
Return true if this Info matches another Info object.

toString

public String toString()
Return a description of this Info object.