Open giuliomoro opened 7 years ago
Also note that my current build does not build src/examples/streaming_ringbuffertofile.cpp
but I believe the file would fail at compile time because of
StreamingAlgorithm* ringBufferInput = streaming::AlgorithmFactory::create("RingBufferInput");
StreamingAlgorithm* ringBufferOutput = streaming::AlgorithmFactory::create("RingBufferOutput");
Just include those RingBuffer headers explicitly like we do here:-
https://github.com/GiantSteps/MC-Sonaar/blob/master/essentiaRT~/EssentiaOnset.h
Thanks, what should that fix? When including those headers I see no change in issues a) and b) described above (and I would not expect any). Note that I fixed a) here https://github.com/MTG/essentia/pull/642
Any specific reason you want to instantiate them using AlgorithmFactory?
They are "special" algorithm just like "DevNull" or "VectorInput" and others. They were deliberately put in src/essentia/streaming/algorithms at some point in time. These algorithms form a core part of Essentia streaming C++ API and they aren't included in Python bindings.
I could not make much sense of the documentation and the two examples I found which were using RingBuffer
were not compiling:
src/examples/streaming_ringbuffertofile.cpp
uses an AlgorithmFactory
but would not compile without my patchSo I had to find my own way through, which involved the above patch and so I could do
essentia::streaming::AlgorithmFactory::Registrar<essentia::streaming::RingBufferInput> regRingBufferInput;
ringBufferInput = dynamic_cast<RingBufferInput*>(factory.create("RingBufferInput", "bufferSize", 16384));
instead of
ParameterMap pars;
pars.add("bufferSize", 16384);
ringBufferInput = new RingBufferInput();
ringBufferInput->declareParameters();
ringBufferInput->setParameters(pars);
ringBufferInput->configure();
I felt that the latter solution was less elegant and more error-prone than the former.
This is because of the following:
a) They are missing the
description
field.b) they are not registered, so you have to manually call
and
a) is the real issue, while b) can be worked-around by the user, though it would be nice to fix b) as well.