com.jsyn.devices
Interface AudioDeviceManager

All Known Implementing Classes:
JavaSoundAudioDevice

public interface AudioDeviceManager

Interface for an audio system. This may be implemented using JavaSound, or a native device wrapper.


Method Summary
 AudioDeviceInputStream createInputStream(int deviceID, int frameRate, int numInputChannels)
          Create a stream that can be used by JSyn for acquiring audio data.
 AudioDeviceOutputStream createOutputStream(int deviceID, int frameRate, int numOutputChannels)
          Create a stream that can be used by JSyn for outputting audio data.
 double getDefaultHighInputLatency(int deviceID)
          This the highest latency that the device can support.
 double getDefaultHighOutputLatency(int deviceID)
           
 int getDefaultInputDeviceID()
          The user can generally select a default device using a control panel that is part of the operating system.
 double getDefaultLowInputLatency(int deviceID)
          This the lowest latency that the device can support reliably.
 double getDefaultLowOutputLatency(int deviceID)
           
 int getDefaultOutputDeviceID()
          The user can generally select a default device using a control panel that is part of the operating system.
 int getDeviceCount()
           
 java.lang.String getDeviceName(int deviceID)
           
 int getMaxInputChannels(int deviceID)
           
 int getMaxOutputChannels(int deviceID)
           
 int setSuggestedInputLatency(double latency)
          Set latency in seconds for the audio device.
 int setSuggestedOutputLatency(double latency)
           
 

Method Detail

getDeviceCount

int getDeviceCount()
Returns:
The number of devices available.

getDeviceName

java.lang.String getDeviceName(int deviceID)
Parameters:
deviceID -
Returns:
A name that can be shown to the user.

getDefaultInputDeviceID

int getDefaultInputDeviceID()
The user can generally select a default device using a control panel that is part of the operating system.

Returns:
The ID for the input device that the user has selected as the default.

getDefaultOutputDeviceID

int getDefaultOutputDeviceID()
The user can generally select a default device using a control panel that is part of the operating system.

Returns:
The ID for the output device that the user has selected as the default.

getMaxInputChannels

int getMaxInputChannels(int deviceID)
Parameters:
deviceID -
Returns:
The maximum number of channels that the device will support.

getMaxOutputChannels

int getMaxOutputChannels(int deviceID)
Parameters:
deviceID -
Returns:
The maximum number of channels that the device will support.

getDefaultLowInputLatency

double getDefaultLowInputLatency(int deviceID)
This the lowest latency that the device can support reliably. It should be used for applications that require low latency such as live processing of guitar signals.

Parameters:
deviceID -
Returns:
Latency in seconds.

getDefaultHighInputLatency

double getDefaultHighInputLatency(int deviceID)
This the highest latency that the device can support. High latency is recommended for applications that are not time critical, such as recording.

Parameters:
deviceID -
Returns:
Latency in seconds.

getDefaultLowOutputLatency

double getDefaultLowOutputLatency(int deviceID)

getDefaultHighOutputLatency

double getDefaultHighOutputLatency(int deviceID)

setSuggestedInputLatency

int setSuggestedInputLatency(double latency)
Set latency in seconds for the audio device. If set to zero then the DefaultLowLatency value for the device will be used. This is just a suggestion that will be used when the AudioDeviceInputStream is started.


setSuggestedOutputLatency

int setSuggestedOutputLatency(double latency)

createOutputStream

AudioDeviceOutputStream createOutputStream(int deviceID,
                                           int frameRate,
                                           int numOutputChannels)
Create a stream that can be used by JSyn for outputting audio data.


createInputStream

AudioDeviceInputStream createInputStream(int deviceID,
                                         int frameRate,
                                         int numInputChannels)
Create a stream that can be used by JSyn for acquiring audio data.