|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.beadsproject.beads.core.Bead net.beadsproject.beads.core.UGen net.beadsproject.beads.analysis.Segmenter
public abstract class Segmenter
A Segmenter is an abstract base class for classes that divide a stream of audio data into segments. Whenever a segment is created, using the method segment(float[], int)
, it is passed on to any FeatureExtractor
s that are registered as responders to this Segmenter. Other Bead
s can be added as listeners, that are triggered when segment(float[], int)
is called.
An implementation of a Segmenter must implement the method UGen.calculateBuffer()
, and determine when segment(float[], int)
should be called, passing the audio data accordingly (this may require the Segmenter to record audio data).
In addition, the Segmenter keeps track of analysis data in a FeatureTrack
for any FeatureExtractor
s registered as extractors with this Segmenter.
segment(float[], int)
correctly indicates the length since the previous segment.
Field Summary | |
---|---|
protected double |
currentTime
The current time in milliseconds since start. |
protected double |
previousEndTime
The previous end time in milliseconds since start. |
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outs |
Constructor Summary | |
---|---|
Segmenter(AudioContext context)
Instantiates a new Segmenter. |
Method Summary | |
---|---|
void |
addListener(Bead bead)
Adds a Bead as a listener. |
void |
addListener(FeatureExtractor<?,float[]> fe)
Adds a FeatureExtractor as a responder to this Segmenter. |
protected void |
segment(float[] data,
int sampleOffset)
Called by instantiations of Segmenter, to indicate that a new segment has been created. |
void |
startTime()
Sets the start time to now (now being determined by the AudioContext). |
java.lang.String |
toString()
Returns a String specifying the Bead's class and it's name. |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
addDependent, addInput, addInput, calculateBuffer, clearInputConnections, getContext, getIns, getNumberOfConnectedUGens, getOuts, getValue, getValue, noInputs, pause, printInputList, printOutBuffers, removeAllConnections, removeDependent, setValue, update, zeroIns, zeroOuts |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double currentTime
protected double previousEndTime
Constructor Detail |
---|
public Segmenter(AudioContext context)
context
- the AudioContext.Method Detail |
---|
public void startTime()
public void addListener(FeatureExtractor<?,float[]> fe)
fe
- the FeatureExtractor.public void addListener(Bead bead)
segment(float[], int)
method is called.
bead
- the Bead.protected void segment(float[] data, int sampleOffset)
data
- the audio data.length
- the number of samples since the previous data.public java.lang.String toString()
Bead
toString
in class Bead
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |