src/share/classes/javax/sound/sampled/DataLine.java

Print this page




 338          * which includes a single audio format. This constructor is typically
 339          * used by an application to describe a desired line.
 340          *
 341          * @param  lineClass the class of the data line described by the info
 342          *         object
 343          * @param  format desired format
 344          */
 345         public Info(Class<?> lineClass, AudioFormat format) {
 346             this(lineClass, format, AudioSystem.NOT_SPECIFIED);
 347         }
 348 
 349         /**
 350          * Obtains a set of audio formats supported by the data line. Note that
 351          * {@code isFormatSupported(AudioFormat)} might return {@code true} for
 352          * certain additional formats that are missing from the set returned by
 353          * {@code getFormats()}. The reverse is not the case:
 354          * {@code isFormatSupported(AudioFormat)} is guaranteed to return
 355          * {@code true} for all formats returned by {@code getFormats()}.
 356          * <p>
 357          * Some fields in the AudioFormat instances can be set to
 358          * {@link javax.sound.sampled.AudioSystem#NOT_SPECIFIED NOT_SPECIFIED}
 359          * if that field does not apply to the format, or if the format supports
 360          * a wide range of values for that field. For example, a multi-channel
 361          * device supporting up to 64 channels, could set the channel field in
 362          * the {@code AudioFormat} instances returned by this method to
 363          * {@code NOT_SPECIFIED}.
 364          *
 365          * @return a set of supported audio formats
 366          * @see #isFormatSupported(AudioFormat)
 367          */
 368         public AudioFormat[] getFormats() {
 369             return Arrays.copyOf(formats, formats.length);
 370         }
 371 
 372         /**
 373          * Indicates whether this data line supports a particular audio format.
 374          * The default implementation of this method simply returns {@code true}
 375          * if the specified format matches any of the supported formats.
 376          *
 377          * @param  format the audio format for which support is queried
 378          * @return {@code true} if the format is supported, otherwise
 379          *         {@code false}
 380          * @see #getFormats
 381          * @see AudioFormat#matches
 382          */




 338          * which includes a single audio format. This constructor is typically
 339          * used by an application to describe a desired line.
 340          *
 341          * @param  lineClass the class of the data line described by the info
 342          *         object
 343          * @param  format desired format
 344          */
 345         public Info(Class<?> lineClass, AudioFormat format) {
 346             this(lineClass, format, AudioSystem.NOT_SPECIFIED);
 347         }
 348 
 349         /**
 350          * Obtains a set of audio formats supported by the data line. Note that
 351          * {@code isFormatSupported(AudioFormat)} might return {@code true} for
 352          * certain additional formats that are missing from the set returned by
 353          * {@code getFormats()}. The reverse is not the case:
 354          * {@code isFormatSupported(AudioFormat)} is guaranteed to return
 355          * {@code true} for all formats returned by {@code getFormats()}.
 356          * <p>
 357          * Some fields in the AudioFormat instances can be set to
 358          * {@link AudioSystem#NOT_SPECIFIED NOT_SPECIFIED} if that field does
 359          * not apply to the format, or if the format supports a wide range of
 360          * values for that field. For example, a multi-channel device supporting
 361          * up to 64 channels, could set the channel field in the
 362          * {@code AudioFormat} instances returned by this method to
 363          * {@code NOT_SPECIFIED}.
 364          *
 365          * @return a set of supported audio formats
 366          * @see #isFormatSupported(AudioFormat)
 367          */
 368         public AudioFormat[] getFormats() {
 369             return Arrays.copyOf(formats, formats.length);
 370         }
 371 
 372         /**
 373          * Indicates whether this data line supports a particular audio format.
 374          * The default implementation of this method simply returns {@code true}
 375          * if the specified format matches any of the supported formats.
 376          *
 377          * @param  format the audio format for which support is queried
 378          * @return {@code true} if the format is supported, otherwise
 379          *         {@code false}
 380          * @see #getFormats
 381          * @see AudioFormat#matches
 382          */