|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.frinika.audio.toot.SynchronizedAudioProcess
public abstract class SynchronizedAudioProcess
An audioprocess that can be synchronized from an outside timing source. Useful for e.g. audio playback to be synchronized with a sequencer.
| Field Summary |
|---|
| Fields inherited from interface uk.org.toot.audio.core.AudioProcess |
|---|
AUDIO_DISCONNECT, AUDIO_OK |
| Constructor Summary | |
|---|---|
SynchronizedAudioProcess(uk.org.toot.audio.server.AudioServer audioServer,
long initialFramePos)
Construct a new Synchronized audioProcess. |
|
| Method Summary | |
|---|---|
protected long |
getFramePos()
Call this method from fillBufferSynchronized to get the framePos according to the external timing source |
protected int |
getMissedFrames()
Call this method from fillBufferSynchronized to get the number of missing frames (glitch) after an external sync notification NOTE: Your tolerance on missed frames should not be too low - since timing functions like System.currentTimeMillis might slide up to 50 ms on some systems. |
int |
getMissedFramesToleranceMillis()
Number of milliseconds of glitch before synchronization if enforced |
int |
processAudio(uk.org.toot.audio.core.AudioBuffer buffer)
|
abstract void |
processAudioSynchronized(uk.org.toot.audio.core.AudioBuffer buffer)
|
void |
setFramePos(long framePos)
The external timing source should regularly notify with the current frame position here |
void |
setMissedFramesToleranceMillis(int missedFramesToleranceMillis)
Set number of milliseconds of glitch before synchronization if enforced |
| 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.core.AudioProcess |
|---|
close, open |
| Constructor Detail |
|---|
public SynchronizedAudioProcess(uk.org.toot.audio.server.AudioServer audioServer,
long initialFramePos)
voiceServer - initialFramePos - - the initial position of playback start - relative to audio clip start| Method Detail |
|---|
public int getMissedFramesToleranceMillis()
public void setMissedFramesToleranceMillis(int missedFramesToleranceMillis)
missedFramesToleranceMillis - public void setFramePos(long framePos)
framePos - protected final long getFramePos()
protected final int getMissedFrames()
public int processAudio(uk.org.toot.audio.core.AudioBuffer buffer)
processAudio in interface uk.org.toot.audio.core.AudioProcesspublic abstract void processAudioSynchronized(uk.org.toot.audio.core.AudioBuffer buffer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||