com.jsyn.devices.javasound
Class JavaSoundAudioDevice

java.lang.Object
  extended by com.jsyn.devices.javasound.JavaSoundAudioDevice
All Implemented Interfaces:
AudioDeviceManager

public class JavaSoundAudioDevice
extends java.lang.Object
implements AudioDeviceManager

Use JavaSound to access the audio hardware.


Constructor Summary
JavaSoundAudioDevice()
           
 
Method Summary
 AudioDeviceInputStream createInputStream(int deviceID, int frameRate, int samplesPerFrame)
          Create a stream that can be used by JSyn for acquiring audio data.
 AudioDeviceOutputStream createOutputStream(int deviceID, int frameRate, int samplesPerFrame)
          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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSoundAudioDevice

public JavaSoundAudioDevice()
Method Detail

createOutputStream

public AudioDeviceOutputStream createOutputStream(int deviceID,
                                                  int frameRate,
                                                  int samplesPerFrame)
Description copied from interface: AudioDeviceManager
Create a stream that can be used by JSyn for outputting audio data.

Specified by:
createOutputStream in interface AudioDeviceManager

createInputStream

public AudioDeviceInputStream createInputStream(int deviceID,
                                                int frameRate,
                                                int samplesPerFrame)
Description copied from interface: AudioDeviceManager
Create a stream that can be used by JSyn for acquiring audio data.

Specified by:
createInputStream in interface AudioDeviceManager

getDefaultHighInputLatency

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

Specified by:
getDefaultHighInputLatency in interface AudioDeviceManager
Returns:
Latency in seconds.

getDefaultHighOutputLatency

public double getDefaultHighOutputLatency(int deviceID)
Specified by:
getDefaultHighOutputLatency in interface AudioDeviceManager

getDefaultInputDeviceID

public int getDefaultInputDeviceID()
Description copied from interface: AudioDeviceManager
The user can generally select a default device using a control panel that is part of the operating system.

Specified by:
getDefaultInputDeviceID in interface AudioDeviceManager
Returns:
The ID for the input device that the user has selected as the default.

getDefaultOutputDeviceID

public int getDefaultOutputDeviceID()
Description copied from interface: AudioDeviceManager
The user can generally select a default device using a control panel that is part of the operating system.

Specified by:
getDefaultOutputDeviceID in interface AudioDeviceManager
Returns:
The ID for the output device that the user has selected as the default.

getDefaultLowInputLatency

public double getDefaultLowInputLatency(int deviceID)
Description copied from interface: AudioDeviceManager
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.

Specified by:
getDefaultLowInputLatency in interface AudioDeviceManager
Returns:
Latency in seconds.

getDefaultLowOutputLatency

public double getDefaultLowOutputLatency(int deviceID)
Specified by:
getDefaultLowOutputLatency in interface AudioDeviceManager

getDeviceCount

public int getDeviceCount()
Specified by:
getDeviceCount in interface AudioDeviceManager
Returns:
The number of devices available.

getDeviceName

public java.lang.String getDeviceName(int deviceID)
Specified by:
getDeviceName in interface AudioDeviceManager
Returns:
A name that can be shown to the user.

getMaxInputChannels

public int getMaxInputChannels(int deviceID)
Specified by:
getMaxInputChannels in interface AudioDeviceManager
Returns:
The maximum number of channels that the device will support.

getMaxOutputChannels

public int getMaxOutputChannels(int deviceID)
Specified by:
getMaxOutputChannels in interface AudioDeviceManager
Returns:
The maximum number of channels that the device will support.

setSuggestedOutputLatency

public int setSuggestedOutputLatency(double latency)
Specified by:
setSuggestedOutputLatency in interface AudioDeviceManager

setSuggestedInputLatency

public int setSuggestedInputLatency(double latency)
Description copied from interface: AudioDeviceManager
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.

Specified by:
setSuggestedInputLatency in interface AudioDeviceManager