|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.org.toot.audio.server.AbstractAudioServer
uk.org.toot.audio.server.TimedAudioServer
public abstract class TimedAudioServer
TimedAudioServer extends AbstractAudioServer to control the timing of an AudioClient. The buffer size, latency and timing strategy may be varied while running. Note that changing latency may cause inputs to glitch.
Field Summary | |
---|---|
protected boolean |
hasStopped
|
protected boolean |
isRunning
|
protected float |
maximumLatencyMilliseconds
|
protected int |
stableCount
|
protected int |
stableThreshold
|
protected boolean |
started
|
protected AudioSyncLine |
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 | |
---|---|
TimedAudioServer()
|
Method Summary | |
---|---|
protected int |
calculateBufferFrames()
|
protected boolean |
canStart()
|
protected void |
controlGained()
Called when the control loop gains control. |
float |
getActualLatencyMilliseconds()
Return the actual instantaneous software output latency in milliseconds. |
float |
getBufferMilliseconds()
Return the duration of the buffers in milliseconds. |
int |
getBufferUnderRuns()
Return the number of buffer underruns which may have resulted in an audio glitch. |
float |
getLatencyMilliseconds()
Return the requested software output latency in milliseconds. |
float |
getLowestLatencyMilliseconds()
Because latency is measured just after writing a buffer and represents the maximum latency, the lowest latency has to be compensated by the duration of the buffer. |
float |
getMaximumLatencyMilliseconds()
Return the maximum software output latency which may be requested. |
float |
getMinimumLatencyMilliseconds()
Return the minimum software output latency which may be requested. |
int |
getTotalLatencyFrames()
Return the total latency from analogue input to analogue output. |
boolean |
isRunning()
|
protected void |
reset()
|
void |
resetMetrics(boolean resetUnderruns)
|
void |
run()
|
void |
setBufferMilliseconds(float ms)
Set the duration of the buffers in milliseconds. |
void |
setLatencyMilliseconds(float ms)
Set the software output latency request in milliseconds. |
protected void |
startImpl()
|
protected void |
stopImpl()
|
protected void |
sync()
Called synchronously with the server to simplify concurrency issues. |
Methods inherited from class uk.org.toot.audio.server.AbstractAudioServer |
---|
_createAudioBuffer, checkStart, createAudioBuffer, getBufferFrames, getLoad, removeAudioBuffer, resizeBuffers, setClient, start, stop, work |
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.ExtendedAudioServer |
---|
getConfigKey, getInputs, getOutputs, getSampleSizeInBits |
Methods inherited from interface uk.org.toot.audio.server.AudioServer |
---|
closeAudioInput, closeAudioOutput, createAudioBuffer, getAvailableInputNames, getAvailableOutputNames, getInputLatencyFrames, getLoad, getOutputLatencyFrames, getSampleRate, openAudioInput, openAudioOutput, setClient, start, stop |
Field Detail |
---|
protected boolean isRunning
protected boolean hasStopped
protected float maximumLatencyMilliseconds
protected AudioSyncLine syncLine
protected boolean started
protected int stableCount
protected int stableThreshold
Constructor Detail |
---|
public TimedAudioServer()
Method Detail |
---|
protected boolean canStart()
canStart
in class AbstractAudioServer
protected void startImpl()
startImpl
in class AbstractAudioServer
protected void stopImpl()
stopImpl
in class AbstractAudioServer
public boolean isRunning()
isRunning
in interface uk.org.toot.audio.server.AudioServer
public int getTotalLatencyFrames()
getTotalLatencyFrames
in interface uk.org.toot.audio.server.AudioServer
public void run()
run
in interface java.lang.Runnable
protected void sync()
protected void controlGained()
public void resetMetrics(boolean resetUnderruns)
resetMetrics
in interface ExtendedAudioServer
protected void reset()
public void setLatencyMilliseconds(float ms)
setLatencyMilliseconds
in interface ExtendedAudioServer
public float getLatencyMilliseconds()
getLatencyMilliseconds
in interface ExtendedAudioServer
public float getActualLatencyMilliseconds()
getActualLatencyMilliseconds
in interface ExtendedAudioServer
public float getLowestLatencyMilliseconds()
getLowestLatencyMilliseconds
in interface ExtendedAudioServer
public float getMinimumLatencyMilliseconds()
getMinimumLatencyMilliseconds
in interface ExtendedAudioServer
public float getMaximumLatencyMilliseconds()
getMaximumLatencyMilliseconds
in interface ExtendedAudioServer
public int getBufferUnderRuns()
getBufferUnderRuns
in interface ExtendedAudioServer
protected int calculateBufferFrames()
public float getBufferMilliseconds()
getBufferMilliseconds
in interface ExtendedAudioServer
public void setBufferMilliseconds(float ms)
setBufferMilliseconds
in interface ExtendedAudioServer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |