uk.org.toot.audio.server
Class JavaSoundAudioServer

java.lang.Object
  extended by uk.org.toot.audio.server.AbstractAudioServer
      extended by uk.org.toot.audio.server.TimedAudioServer
          extended by com.frinika.toot.PriorityAudioServer
              extended by uk.org.toot.audio.server.JavaSoundAudioServer
All Implemented Interfaces:
java.lang.Runnable, uk.org.toot.audio.server.AudioServer, ExtendedAudioServer
Direct Known Subclasses:
MultiIOJavaSoundAudioServer

public class JavaSoundAudioServer
extends PriorityAudioServer

JavaSoundAudioServer extends BasicAudioServer with JavaSound-style byte[] buffer provision and management and JavaSound audio I/O provision.


Nested Class Summary
protected  class JavaSoundAudioServer.JavaSoundAudioInput
           
protected  class JavaSoundAudioServer.JavaSoundAudioLine
           
protected  class JavaSoundAudioServer.JavaSoundAudioOutput
           
 
Field Summary
 
Fields inherited from class uk.org.toot.audio.server.TimedAudioServer
hasStopped, isRunning, maximumLatencyMilliseconds, stableCount, stableThreshold, started, syncLine
 
Fields inherited from class uk.org.toot.audio.server.AbstractAudioServer
bufferFrames, endTimeNanos, startTimeNanos
 
Fields inherited from interface uk.org.toot.audio.server.AudioServer
THREAD_NAME
 
Constructor Summary
JavaSoundAudioServer()
           
 
Method Summary
protected  void checkFormat()
           
 void closeAudioInput(uk.org.toot.audio.server.IOAudioProcess input)
           
 void closeAudioOutput(uk.org.toot.audio.server.IOAudioProcess output)
           
protected  void controlGained()
          Called when the control loop gains control.
protected  byte[] createByteBuffer()
           
 java.util.List<java.lang.String> getAvailableInputNames()
           
 java.util.List<java.lang.String> getAvailableOutputNames()
           
 java.lang.String getConfigKey()
           
 int getInputLatencyFrames()
           
 java.util.List<AudioLine> getInputs()
           
 int getOutputLatencyFrames()
           
 java.util.List<AudioLine> getOutputs()
           
 float getSampleRate()
           
 int getSampleSizeInBits()
           
protected  javax.sound.sampled.Mixer.Info inputForName(java.lang.String name)
           
protected  void minimiseInputLatency()
           
 uk.org.toot.audio.server.IOAudioProcess openAudioInput(java.lang.String name, java.lang.String label)
           
 uk.org.toot.audio.server.IOAudioProcess openAudioOutput(java.lang.String name, java.lang.String label)
           
protected  javax.sound.sampled.Mixer.Info outputForName(java.lang.String name)
           
protected  void resizeBuffers(int bufferFrames)
           
 void setLatencyMilliseconds(float ms)
          Set the software output latency request in milliseconds.
 void setSampleRate(float sampleRate)
           
 void setSampleSizeInBits(int sampleSizeInBits)
           
protected  void startImpl()
           
protected  void stopImpl()
           
 
Methods inherited from class com.frinika.toot.PriorityAudioServer
assertPriority, getPriority, requestPriority, work
 
Methods inherited from class uk.org.toot.audio.server.TimedAudioServer
calculateBufferFrames, canStart, getActualLatencyMilliseconds, getBufferMilliseconds, getBufferUnderRuns, getLatencyMilliseconds, getLowestLatencyMilliseconds, getMaximumLatencyMilliseconds, getMinimumLatencyMilliseconds, getTotalLatencyFrames, isRunning, reset, resetMetrics, run, setBufferMilliseconds, sync
 
Methods inherited from class uk.org.toot.audio.server.AbstractAudioServer
_createAudioBuffer, checkStart, createAudioBuffer, getBufferFrames, getLoad, removeAudioBuffer, setClient, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.org.toot.audio.server.AudioServer
createAudioBuffer, getLoad, setClient, start, stop
 

Constructor Detail

JavaSoundAudioServer

public JavaSoundAudioServer()
Method Detail

checkFormat

protected void checkFormat()

getSampleSizeInBits

public int getSampleSizeInBits()

setSampleSizeInBits

public void setSampleSizeInBits(int sampleSizeInBits)

getSampleRate

public float getSampleRate()

setSampleRate

public void setSampleRate(float sampleRate)

getOutputs

public java.util.List<AudioLine> getOutputs()

getInputs

public java.util.List<AudioLine> getInputs()

resizeBuffers

protected void resizeBuffers(int bufferFrames)
Overrides:
resizeBuffers in class AbstractAudioServer

createByteBuffer

protected byte[] createByteBuffer()

getOutputLatencyFrames

public int getOutputLatencyFrames()

getInputLatencyFrames

public int getInputLatencyFrames()

getAvailableOutputNames

public java.util.List<java.lang.String> getAvailableOutputNames()

getAvailableInputNames

public java.util.List<java.lang.String> getAvailableInputNames()

inputForName

protected javax.sound.sampled.Mixer.Info inputForName(java.lang.String name)

outputForName

protected javax.sound.sampled.Mixer.Info outputForName(java.lang.String name)

startImpl

protected void startImpl()
Overrides:
startImpl in class TimedAudioServer

stopImpl

protected void stopImpl()
Overrides:
stopImpl in class TimedAudioServer

openAudioOutput

public uk.org.toot.audio.server.IOAudioProcess openAudioOutput(java.lang.String name,
                                                               java.lang.String label)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

closeAudioOutput

public void closeAudioOutput(uk.org.toot.audio.server.IOAudioProcess output)

openAudioInput

public uk.org.toot.audio.server.IOAudioProcess openAudioInput(java.lang.String name,
                                                              java.lang.String label)
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

closeAudioInput

public void closeAudioInput(uk.org.toot.audio.server.IOAudioProcess input)

setLatencyMilliseconds

public void setLatencyMilliseconds(float ms)
Description copied from class: TimedAudioServer
Set the software output latency request in milliseconds. This is the demand to the control loop.

Specified by:
setLatencyMilliseconds in interface ExtendedAudioServer
Overrides:
setLatencyMilliseconds in class TimedAudioServer

minimiseInputLatency

protected void minimiseInputLatency()

controlGained

protected void controlGained()
Description copied from class: TimedAudioServer
Called when the control loop gains control.

Overrides:
controlGained in class TimedAudioServer

getConfigKey

public java.lang.String getConfigKey()