jass.generators
Class StreamingAudioGroove

java.lang.Object
  extended by jass.engine.Out
      extended by jass.generators.AudioGroove
          extended by jass.generators.StreamingAudioGroove
All Implemented Interfaces:
Source

public abstract class StreamingAudioGroove
extends AudioGroove

Position based playback of audio date (gramophone model). Wavfile (mono) is indexed with position of needle on record. Every call to getBuffer this UG polls for position of needle in seconds, and uses this with the previous saved value to index a wav file and compute an audio buffer for the corresponding segment. Method to obtain position of needle is abstract. Streams audio off source

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
 
Fields inherited from class jass.generators.AudioGroove
grooveBuffer, grooveBufferLength, name, posNeedle, posNeedlePast, srate, srateGrooveBuffer, srateRatio
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
StreamingAudioGroove(float srate, int bufferSize, java.lang.String fn)
          Construct Groove from named file.
StreamingAudioGroove(float srate, int bufferSize, java.net.URL url)
          Construct Groove from named URL.
StreamingAudioGroove(int bufferSize)
          For derived classes
 
Method Summary
 void computeBuffer()
          Compute the next buffer.
 float[] getGrooveBuffer()
          Get the groove buffer as array, which is not possible.
 
Methods inherited from class jass.generators.AudioGroove
getPositionOfNeedle
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamingAudioGroove

public StreamingAudioGroove(int bufferSize)
For derived classes

Parameters:
bufferSize - buffer size

StreamingAudioGroove

public StreamingAudioGroove(float srate,
                            int bufferSize,
                            java.lang.String fn)
                     throws UnsupportedAudioFileFormatException
Construct Groove from named file.

Parameters:
srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out
fn - Audio file name.
Throws:
UnsupportedAudioFileFormatException

StreamingAudioGroove

public StreamingAudioGroove(float srate,
                            int bufferSize,
                            java.net.URL url)
                     throws UnsupportedAudioFileFormatException
Construct Groove from named URL.

Parameters:
srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out
url - Audio file url name.
Throws:
UnsupportedAudioFileFormatException
Method Detail

getGrooveBuffer

public float[] getGrooveBuffer()
Get the groove buffer as array, which is not possible. So return null

Overrides:
getGrooveBuffer in class AudioGroove
Returns:
null

computeBuffer

public void computeBuffer()
Compute the next buffer.

Overrides:
computeBuffer in class AudioGroove