|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jass.engine.Out jass.generators.AudioGroove
public abstract class 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. Loads entire clip in memory.
Field Summary | |
---|---|
protected float[] |
grooveBuffer
Buffer with music (groove) |
protected int |
grooveBufferLength
Buffer length |
protected java.lang.String |
name
Name of buffer |
protected double |
posNeedle
Current needle position in seconds |
protected double |
posNeedlePast
Past needle position in seconds |
float |
srate
Sampling rate in Hertz of Out. |
float |
srateGrooveBuffer
Sampling rate in Hertz of loaded buffer. |
protected float |
srateRatio
Sampling rate ratio, srateLoopBuffer/srate |
Fields inherited from class jass.engine.Out |
---|
buf, bufferSize, bufOld, lock |
Constructor Summary | |
---|---|
AudioGroove(float srate,
int bufferSize,
float[] grooveBuffer)
Construct Groove and provide buffer at same sampling rate. |
|
AudioGroove(float srate,
int bufferSize,
java.lang.String fn)
Construct Groove from named file. |
|
AudioGroove(float srate,
int bufferSize,
java.net.URL url)
Construct Groove from named URL. |
|
AudioGroove(int bufferSize)
For derived classes |
Method Summary | |
---|---|
void |
computeBuffer()
Compute the next buffer. |
float[] |
getGrooveBuffer()
Get the groove buffer as array. |
abstract double |
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 |
Field Detail |
---|
protected float[] grooveBuffer
protected int grooveBufferLength
public float srate
protected float srateRatio
public float srateGrooveBuffer
protected java.lang.String name
protected double posNeedle
protected double posNeedlePast
Constructor Detail |
---|
public AudioGroove(int bufferSize)
bufferSize
- buffer sizepublic AudioGroove(float srate, int bufferSize, java.lang.String fn)
srate
- sampling rate in Hertz.bufferSize
- bufferSize of this Outfn
- Audio file name.public AudioGroove(float srate, int bufferSize, java.net.URL url)
srate
- sampling rate in Hertz.bufferSize
- bufferSize of this Outurl
- Audio file url name.public AudioGroove(float srate, int bufferSize, float[] grooveBuffer)
srate
- sampling rate in Hertz.bufferSize
- bufferSize of this Out.grooveBuffer
- groove buffer.Method Detail |
---|
public float[] getGrooveBuffer()
public abstract double getPositionOfNeedle()
public void computeBuffer()
computeBuffer
in class Out
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |