Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.device
Class PortAudioAuto

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.device.PortAudioAuto

public class PortAudioAuto
extends Object

Creates PortAudio capture devices by enumerating all host devices that have input channels.

Author:
Damian Minkov, Lyubomir Marinov

Field Summary
static javax.media.CaptureDeviceInfo defaultCaptureDevice
          The default capture device.
static javax.media.CaptureDeviceInfo defaultPlaybackDevice
          The default playback device.
static String LOCATOR_PROTOCOL
          The protocol of the MediaLocators identifying PortAudio CaptureDevices
static javax.media.CaptureDeviceInfo[] playbackDevices
          An array of the devices that can be used for playback.
 
Constructor Summary
PortAudioAuto()
          Initializes a new PortAudioAuto instance which creates PortAudio capture devices by enumerating all host devices with input channels.
 
Method Summary
 void deviceChanged()
          PortAudio device changed callback.
static double getSupportedSampleRate(boolean input, int deviceIndex, int channelCount, long sampleFormat)
          Gets a sample rate supported by a PortAudio device with a specific device index with which it is to be registered with JMF.
static boolean isSupported()
          Determines whether PortAudio is supported.
 void reinit()
          Reinitializes PortAudio system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATOR_PROTOCOL

public static final String LOCATOR_PROTOCOL
The protocol of the MediaLocators identifying PortAudio CaptureDevices

See Also:
Constant Field Values

playbackDevices

public static javax.media.CaptureDeviceInfo[] playbackDevices
An array of the devices that can be used for playback.


defaultPlaybackDevice

public static javax.media.CaptureDeviceInfo defaultPlaybackDevice
The default playback device.


defaultCaptureDevice

public static javax.media.CaptureDeviceInfo defaultCaptureDevice
The default capture device.

Constructor Detail

PortAudioAuto

PortAudioAuto()
        throws Exception
Initializes a new PortAudioAuto instance which creates PortAudio capture devices by enumerating all host devices with input channels.

Throws:
Exception - if anything wrong happens while creating the PortAudio capture devices
Method Detail

deviceChanged

public void deviceChanged()
PortAudio device changed callback.


reinit

public void reinit()
            throws Exception
Reinitializes PortAudio system.

Throws:
Exception - if anything wrong happens while creating the PortAudio capture devices

getSupportedSampleRate

public static double getSupportedSampleRate(boolean input,
                                            int deviceIndex,
                                            int channelCount,
                                            long sampleFormat)
Gets a sample rate supported by a PortAudio device with a specific device index with which it is to be registered with JMF.

Parameters:
input - true if the supported sample rate is to be retrieved for the PortAudio device with the specified device index as an input device or false for an output device
deviceIndex - the device index of the PortAudio device for which a supported sample rate is to be retrieved
channelCount - number of channel
sampleFormat - sample format
Returns:
a sample rate supported by the PortAudio device with the specified device index with which it is to be registered with JMF

isSupported

public static boolean isSupported()
Determines whether PortAudio is supported.

Returns:
true if PortAudio is supported; otherwise, false

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.