com.frinika.sequencer.model.audio
Class AudioStreamVoice

java.lang.Object
  extended by com.frinika.audio.toot.SynchronizedAudioProcess
      extended by com.frinika.sequencer.model.audio.AudioStreamVoice
All Implemented Interfaces:
uk.org.toot.audio.core.AudioProcess

public class AudioStreamVoice
extends SynchronizedAudioProcess


Field Summary
 
Fields inherited from interface uk.org.toot.audio.core.AudioProcess
AUDIO_DISCONNECT, AUDIO_OK
 
Constructor Summary
AudioStreamVoice(uk.org.toot.audio.server.AudioServer audioServer, FrinikaSequencer sequencer, AudioReader ais, long clipStartTimePosition1)
          Construct a DAAudioStreamVoice.
 
Method Summary
 void close()
           
 void open()
           
 void processAudioSynchronized(uk.org.toot.audio.core.AudioBuffer buffer)
           
 void setRealStartTime(long realStartTime)
           
 void setRunning(boolean running)
          Tell the voice whether to play or not (if the sequencer is running)
 
Methods inherited from class com.frinika.audio.toot.SynchronizedAudioProcess
getFramePos, getMissedFrames, getMissedFramesToleranceMillis, processAudio, setFramePos, setMissedFramesToleranceMillis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioStreamVoice

public AudioStreamVoice(uk.org.toot.audio.server.AudioServer audioServer,
                        FrinikaSequencer sequencer,
                        AudioReader ais,
                        long clipStartTimePosition1)
                 throws java.lang.Exception
Construct a DAAudioStreamVoice. This is an extension of the SynchronizedVoice which uses a sequencer as synchronization source. The extended SynchronizedVoice class requires that we initially provide an offset for where in the clip to start (initialFramePos parameter), but the synchronization will then correct the position as the clip is playing. Thus we'll use the same formula as the synchronization to calculate the initialFramePos.

Parameters:
voiceServer - - The voice server we're playing in
sequencer - - the sequencer that we are playing in
ais - - The audio clip input stream
clipStartTimePosition - - The start time in microseconds relative to Start time relative to sequencer zero time
modulator - Evelope for the audio (can be null)
Throws:
java.lang.Exception
Method Detail

setRunning

public void setRunning(boolean running)
Tell the voice whether to play or not (if the sequencer is running)


processAudioSynchronized

public void processAudioSynchronized(uk.org.toot.audio.core.AudioBuffer buffer)
Specified by:
processAudioSynchronized in class SynchronizedAudioProcess

setRealStartTime

public void setRealStartTime(long realStartTime)

close

public void close()

open

public void open()