|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.frinika.audio.VoiceServer
public abstract class VoiceServer
The VoiceServer terminates the audio output of all voices, by polling them sequentially for small buffers of data. The buffer size also determines the latency of the server, thus also for all the VoiceGenerators (softsynths) it is hosting. The VoiceServer is an abstract class which should be extended and integrated with a sound hardware interface. The voiceserver however provides all functionality needed for timing and synchronization of the voice generators. The VoiceServer has a realtime and a non-realtime mode. Realtime mode is used when playing live - and timing mechanisms has to be accurate. Non realtime mode is used when creating a rendered version of a sequence of sound. For example when exporting a song to a wav file. Routing mechanisms are available using Voice.nextVoice
Field Summary | |
---|---|
protected java.util.Vector<Voice> |
audioOutputGenerators
|
Constructor Summary | |
---|---|
VoiceServer()
|
Method Summary | |
---|---|
void |
addTransmitter(Voice transmitter)
Used by synths to add a new generator (midi note) |
abstract void |
configureAudioOutput(javax.swing.JFrame frame)
|
int |
getBufferSize()
|
long |
getLatency()
Returns the latency in microseconds |
int |
getLatencyAsFrames()
Returns the latency in frames |
int |
getSampleRate()
Returns the current sample rate |
long |
getTotalLatency()
Returns the voiceServer latency plus the operating system latency in microseconds |
int |
getTotalLatencyAsFrames()
Returns the total latency in frames |
void |
interruptTransmitter(Voice transmitter,
VoiceInterrupt interrupt)
Used by synths to trigger a change in an existing generator. |
void |
processFinalOutput(float[] buffer)
Override this method to add processing to the final output |
void |
read(byte[] outBuffer,
float[] floatBuffer)
Read a frame into the given buffers of bytes, and floats |
void |
read(float[] floatBuffer)
Read a frame into the given buffer of floats |
void |
readNonRealtime(byte[] outBuffer,
float[] floatBuffer)
Read a frame into the given buffers of bytes, and floats. |
void |
realtimeOff()
|
void |
realtimeOn()
|
void |
removeTransmitter(Voice transmitter)
Called by the generator itself when it knows that it has finished its processing. |
void |
setSampleRate(int sampleRate)
Change current sample rate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<Voice> audioOutputGenerators
Constructor Detail |
---|
public VoiceServer()
Method Detail |
---|
public final int getSampleRate()
public final void setSampleRate(int sampleRate)
sampleRate
- public final int getBufferSize()
public final void addTransmitter(Voice transmitter)
transmitter
- - the generator to addpublic final void interruptTransmitter(Voice transmitter, VoiceInterrupt interrupt)
transmitter
- interrupt
- public final void removeTransmitter(Voice transmitter)
transmitter
- public void processFinalOutput(float[] buffer)
buffer
- public final void read(float[] floatBuffer)
floatBuffer
- public final void read(byte[] outBuffer, float[] floatBuffer)
outBuffer
- floatBuffer
- public final void readNonRealtime(byte[] outBuffer, float[] floatBuffer)
outBuffer
- floatBuffer
- public final void realtimeOn()
public final void realtimeOff()
public abstract void configureAudioOutput(javax.swing.JFrame frame)
public final long getLatency()
public final int getLatencyAsFrames()
public final long getTotalLatency()
public final int getTotalLatencyAsFrames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |