Package ipsk.audio.mixer
Class MixerManager
- java.lang.Object
-
- ipsk.audio.mixer.MixerManager
-
public class MixerManager extends java.lang.Object
Class to manage audio devices.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
static javax.sound.sampled.Port.Info[]
KNOWN_PORTS
-
Constructor Summary
Constructors Constructor Description MixerManager()
Create new device manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMixerManagerListener(MixerManagerListener acl)
protected void
fireSelectedCaptureMixerChanged()
protected void
fireSelectedPlaybackMixerChanged()
javax.sound.sampled.Mixer
getCaptureMixerByName(java.lang.String name)
javax.sound.sampled.Mixer
getCaptureMixerByName(java.lang.String name, boolean open)
javax.sound.sampled.Mixer.Info[]
getCaptureMixerInfos()
Get infos of available capture devices.javax.sound.sampled.Mixer.Info[]
getCaptureMixerInfos(boolean open)
Get infos of available capture devices.javax.sound.sampled.Mixer[]
getCaptureMixers()
Get available capture devices.javax.sound.sampled.Mixer[]
getCaptureMixers(boolean open)
Get available capture devices.javax.sound.sampled.Mixer[]
getDirectPlaybackMixers()
Get playback devices ignoring 'java Sound Audio Engine'.javax.sound.sampled.Mixer[]
getDirectPlaybackMixers(boolean open)
Get playback devices ignoring 'java Sound Audio Engine'.javax.sound.sampled.Mixer
getPlaybackMixerByName(java.lang.String name)
javax.sound.sampled.Mixer
getPlaybackMixerByName(java.lang.String name, boolean open)
javax.sound.sampled.Mixer.Info[]
getPlaybackMixerInfos()
Get infos of available playback devices.javax.sound.sampled.Mixer.Info[]
getPlaybackMixerInfos(boolean open)
Get infos of available playback devices.javax.sound.sampled.Mixer[]
getPlaybackMixers()
Get available playback devices.javax.sound.sampled.Mixer[]
getPlaybackMixers(boolean open)
Get available playback devicesjavax.sound.sampled.Mixer
getSelectedCaptureMixer()
Get selected capture device.javax.sound.sampled.Mixer
getSelectedPlaybackMixer()
Get selected playback device.static void
main(java.lang.String[] args)
java.lang.String
printPort(javax.sound.sampled.Mixer m, javax.sound.sampled.Port.Info pi)
java.lang.String
printPortControls()
void
removeMixerManagerListener(MixerManagerListener acl)
void
setSelectedCaptureMixer(javax.sound.sampled.Mixer mixer)
Set selected capture device.void
setSelectedCaptureMixer(javax.sound.sampled.Mixer.Info selectedCaptureMixerInfo)
void
setSelectedPlaybackMixer(javax.sound.sampled.Mixer mixer)
Set selected playback device.void
setSelectedPlaybackMixer(javax.sound.sampled.Mixer.Info info)
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
-
KNOWN_PORTS
public static javax.sound.sampled.Port.Info[] KNOWN_PORTS
-
-
Method Detail
-
getPlaybackMixers
public javax.sound.sampled.Mixer[] getPlaybackMixers() throws javax.sound.sampled.LineUnavailableException
Get available playback devices.- Returns:
- array of playback devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getCaptureMixerByName
public javax.sound.sampled.Mixer getCaptureMixerByName(java.lang.String name)
-
getCaptureMixerByName
public javax.sound.sampled.Mixer getCaptureMixerByName(java.lang.String name, boolean open) throws javax.sound.sampled.LineUnavailableException
- Throws:
javax.sound.sampled.LineUnavailableException
-
getPlaybackMixerByName
public javax.sound.sampled.Mixer getPlaybackMixerByName(java.lang.String name)
-
getPlaybackMixerByName
public javax.sound.sampled.Mixer getPlaybackMixerByName(java.lang.String name, boolean open) throws javax.sound.sampled.LineUnavailableException
- Throws:
javax.sound.sampled.LineUnavailableException
-
getPlaybackMixers
public javax.sound.sampled.Mixer[] getPlaybackMixers(boolean open) throws javax.sound.sampled.LineUnavailableException
Get available playback devices- Parameters:
open
- if true open each mixer to check for additional lines- Returns:
- array of playback devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getDirectPlaybackMixers
public javax.sound.sampled.Mixer[] getDirectPlaybackMixers() throws javax.sound.sampled.LineUnavailableException
Get playback devices ignoring 'java Sound Audio Engine'. This is more or less a workaround method: Under Linux JRE 1.4.2 the 'Java Sound Audio Engine' needs about some seconds to open.- Returns:
- playback mixers without 'Java Sound Audio Engine'
- Throws:
javax.sound.sampled.LineUnavailableException
-
getDirectPlaybackMixers
public javax.sound.sampled.Mixer[] getDirectPlaybackMixers(boolean open) throws javax.sound.sampled.LineUnavailableException
Get playback devices ignoring 'java Sound Audio Engine'. This is more or less a workaround method: Under Linux JRE 1.4.2 the 'Java Sound Audio Engine' needs about some seconds to open.- Parameters:
open
- if true open each mixer to check for additional lines- Returns:
- playback mixers without 'Java Sound Audio Engine'
- Throws:
javax.sound.sampled.LineUnavailableException
-
getPlaybackMixerInfos
public javax.sound.sampled.Mixer.Info[] getPlaybackMixerInfos() throws javax.sound.sampled.LineUnavailableException
Get infos of available playback devices.- Returns:
- array of playback devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getPlaybackMixerInfos
public javax.sound.sampled.Mixer.Info[] getPlaybackMixerInfos(boolean open) throws javax.sound.sampled.LineUnavailableException
Get infos of available playback devices.- Parameters:
open
- if true open each mixer to check for additional lines- Returns:
- array of playback devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getCaptureMixers
public javax.sound.sampled.Mixer[] getCaptureMixers() throws javax.sound.sampled.LineUnavailableException
Get available capture devices.- Returns:
- array of capture devices
- Throws:
javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
-
getCaptureMixers
public javax.sound.sampled.Mixer[] getCaptureMixers(boolean open) throws javax.sound.sampled.LineUnavailableException
Get available capture devices.- Parameters:
open
- f true open each mixer to check for additional lines- Returns:
- array of capture devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getCaptureMixerInfos
public javax.sound.sampled.Mixer.Info[] getCaptureMixerInfos() throws javax.sound.sampled.LineUnavailableException
Get infos of available capture devices.- Returns:
- array of capture devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getCaptureMixerInfos
public javax.sound.sampled.Mixer.Info[] getCaptureMixerInfos(boolean open) throws javax.sound.sampled.LineUnavailableException
Get infos of available capture devices.- Parameters:
open
- if true open each mixer to check for additional lines- Returns:
- array of capture devices
- Throws:
javax.sound.sampled.LineUnavailableException
-
getSelectedCaptureMixer
public javax.sound.sampled.Mixer getSelectedCaptureMixer()
Get selected capture device.- Returns:
- selected capture mixer
-
getSelectedPlaybackMixer
public javax.sound.sampled.Mixer getSelectedPlaybackMixer()
Get selected playback device.- Returns:
- selected playback mixer
-
setSelectedCaptureMixer
public void setSelectedCaptureMixer(javax.sound.sampled.Mixer mixer)
Set selected capture device.- Parameters:
mixer
- selected capture mixer
-
setSelectedPlaybackMixer
public void setSelectedPlaybackMixer(javax.sound.sampled.Mixer mixer)
Set selected playback device.- Parameters:
mixer
- selected playback mixer
-
printPort
public java.lang.String printPort(javax.sound.sampled.Mixer m, javax.sound.sampled.Port.Info pi) throws javax.sound.sampled.LineUnavailableException
- Throws:
javax.sound.sampled.LineUnavailableException
-
printPortControls
public java.lang.String printPortControls() throws javax.sound.sampled.LineUnavailableException
- Throws:
javax.sound.sampled.LineUnavailableException
-
addMixerManagerListener
public void addMixerManagerListener(MixerManagerListener acl)
-
removeMixerManagerListener
public void removeMixerManagerListener(MixerManagerListener acl)
-
fireSelectedPlaybackMixerChanged
protected void fireSelectedPlaybackMixerChanged()
-
fireSelectedCaptureMixerChanged
protected void fireSelectedCaptureMixerChanged()
-
setSelectedPlaybackMixer
public void setSelectedPlaybackMixer(javax.sound.sampled.Mixer.Info info)
- Parameters:
info
-
-
setSelectedCaptureMixer
public void setSelectedCaptureMixer(javax.sound.sampled.Mixer.Info selectedCaptureMixerInfo)
- Parameters:
selectedCaptureMixerInfo
-
-
main
public static void main(java.lang.String[] args)
-
-