- java.lang.Object
-
- javax.sound.sampled.Line.Info
-
- javax.sound.sampled.DataLine.Info
-
- Enclosing interface:
- 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:- the audio formats supported by the data line
- the minimum and maximum sizes of its internal buffer
Line.Info
knows the class of the line its describes, aDataLine.Info
object can describeDataLine
subinterfaces such as
,SourceDataLine
, andTargetDataLine
. You can query a mixer for lines of any of these types, passing an appropriate instance ofClip
DataLine.Info
as the argument to a method such as
.Mixer.getLine(Line.Info)
- Since:
- 1.3
- See Also:
Line.Info
-
-
Constructor Summary
Constructors Constructor and Description 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[] 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(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.
-
Method Summary
Methods Modifier and Type Method and Description AudioFormat[]
getFormats()
Obtains a set of audio formats supported by the data line.int
getMaxBufferSize()
Obtains the maximum buffer size supported by the data line.int
getMinBufferSize()
Obtains the minimum buffer size supported by the data line.boolean
isFormatSupported(AudioFormat format)
Indicates whether this data line supports a particular audio format.boolean
matches(Line.Info info)
Determines whether the specified info object matches this one.String
toString()
Obtains a textual description of the data line info.-
Methods inherited from class javax.sound.sampled.Line.Info
getLineClass
-
-
-
-
Constructor Detail
-
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 objectformats
- set of formats supportedminBufferSize
- minimum buffer size supported by the data line, in bytesmaxBufferSize
- maximum buffer size supported by the data line, in bytes
-
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 objectformat
- desired formatbufferSize
- desired buffer size in bytes
-
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 objectformat
- desired format
-
-
Method Detail
-
getFormats
public AudioFormat[] getFormats()
Obtains a set of audio formats supported by the data line. Note thatisFormatSupported(AudioFormat)
might returntrue
for certain additional formats that are missing from the set returned bygetFormats()
. The reverse is not the case:isFormatSupported(AudioFormat)
is guaranteed to returntrue
for all formats returned bygetFormats()
. Some fields in the AudioFormat instances can be set toNOT_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 theAudioFormat
instances returned by this method toNOT_SPECIFIED
.- Returns:
- a set of supported audio formats.
- See Also:
isFormatSupported(AudioFormat)
-
isFormatSupported
public boolean isFormatSupported(AudioFormat format)
Indicates whether this data line supports a particular audio format. The default implementation of this method simply returnstrue
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, otherwisefalse
- See Also:
getFormats()
,AudioFormat.matches(javax.sound.sampled.AudioFormat)
-
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
public int getMaxBufferSize()
Obtains the maximum buffer size supported by the data line.- Returns:
- maximum buffer size in bytes, or
AudioSystem.NOT_SPECIFIED
-
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.
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/sound/sampled/DataLine.Info.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.