SPKitCutter


User's Guide

SPKitCutter is a class for cutting a selected part from an audio signal. By calling the setTimeSlice() function, the user specifies an offset time and duration which SPKitCutter extracs from its input signal.

Programmer's Reference

Defined in <spkit/cutter.h>
Inherits from SPKitProcessor

SPKitCutter defines a setTimeSlice() function for setting an offset and a duration (both in seconds) for selecting a part of the input signal. SPKitCutter disgards all input signal samples preceeding offset and outputs the subsequent samples until its specified duration is reached. SPKitCutter overrides both setInput() and getSample().

Public Members

SPKitError setInput(SPKitProcessor* newInput)
Connect an input to the object and initialize it. offset and dur are set to 0.

Calls SPKitProcessor::setInput().

int getSample(SPKitSample& outputSample, SPKitProcessor* caller)
Retrieve a processed audio sample.

Upon the first call, getSample() repeatedly calls requests samples from its input until offset is reached. Thereafter, it returns one sample at a time until the duration (stored in dur) is reached. getSample() stores the processed sample in outputSample. It returns 0 if either its input runs out of samples or its signal duration is reached. Otherwise, it returns 1.

void setTimeSlice(SPKitFloat o, SPKitFloat d)
set offset to o. and dur to d.

Protected Members

SPKitFloat offset
signal offset time

SPKitFloat duration
signal offset time

SPKitFloat duration
signal offset time

SPKitInt start
signal offset in sample

SPKitInt len
signal duration in samples

SPKitInt scount
a counter for signal start

SPKitInt ecount
a counter for signal end

SPKitInt start
an end-of-signal indicator


Return to top level.

Author: Kai Lassfolk