be.hogent.tarsos.sampled
Class SampledAudioUtilities

java.lang.Object
  extended by be.hogent.tarsos.sampled.SampledAudioUtilities

public final class SampledAudioUtilities
extends java.lang.Object


Method Summary
static java.util.Vector<javax.sound.sampled.Mixer.Info> getMixerInfo(boolean supportsPlayback, boolean supportsRecording)
          Creates a list of Mixer.Info objects.
static javax.sound.sampled.SourceDataLine getOpenLineFromConfiguredMixer(javax.sound.sampled.AudioFormat format)
          Tries to open a line to the configured mixer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMixerInfo

public static java.util.Vector<javax.sound.sampled.Mixer.Info> getMixerInfo(boolean supportsPlayback,
                                                                            boolean supportsRecording)
Creates a list of Mixer.Info objects.

Parameters:
supportsPlayback - Should the mixer support audio play back?
supportsRecording - Should the mixer support audio recording?
Returns:
A list of mixers that fulfill the given conditions.

getOpenLineFromConfiguredMixer

public static javax.sound.sampled.SourceDataLine getOpenLineFromConfiguredMixer(javax.sound.sampled.AudioFormat format)
                                                                         throws javax.sound.sampled.LineUnavailableException
Tries to open a line to the configured mixer. If the line can not be opened and started it falls back on the default line. If this does not work a LineUnavailableException is thrown.

Parameters:
format - the format to open the line for.
Returns:
An open and started line.
Throws:
javax.sound.sampled.LineUnavailableException - if the configured mixer and the default mixer are not available.