Before extending Yaafe, the developper have to be aware of Yaafe‘s general architecture. Please read carefully Yaafe internals.
As a summary, keep in mind that a feature is defined by 2 layers:
To define a new feature, the programmer has to create a subclass of AudioFeature. see examples in the yaafefeatures.py file.
classdocs
PARAMS is a list of tuples defining the parameters of the feature. There are 3 differents ways of defining parameters:
params_dict is a dictionary which allow overiding parameters default value, or masking a parameter we don’t want the user to provide. For example, {'blockSize':'512', 'FFTWindow':None} will overide blockSize default value and mask the FFTWindow parameter.
TRANSFORM is a flag to tell whether the feature is a transformation to apply on another feature (Cepstrum, StatisticalIntegrator), or a raw feature which is computed directly from the audio signal.
Returns a dictionary holding only parameters defined from the PARAMS attribute with default value for those not in the given params dict.
Return the dataflow to compute the feature with the given parameters at the given sample rate. This is the main method to overide when subclassing AudioFeature.
Parameters: |
|
---|---|
Returns: | the feature dataflow |
Return type: |
Returns the list of parameters with their description and default value. Subclasses do not have to overide this function, the parameter list is build automatically from the PARAMS class attribute.
A component is a C++ class which represents computational step, such as FrameTokenizer, FFT, Cepstrum, etc.
To create new components, the programmer has to subclass YAAFE::Component (see file src_cpp/yaafe-core/Component.h).
New components have to be registered to the YAAFE::ComponentFactory. The usual way is to create a dynamic library which will be loaded at runtime, and to expose the function registerYaafeComponents (see src_cpp/yaafe-components/registration.h). The programmer who is integrating Yaafe‘s C++ Engine into his program can load components directly from his code.