DanielSWolf/rhubarb-lip-sync

Any method to integrate rhubarb as lib?

mi2think opened this issue · 3 comments

Hi, As doc shows I can run rhubarb as command tool, input some audio then output a file contain lists of timestamp and viseme.
But for my application it's very slow to read external file then parse it.
Any method to use rhubarb as lib, just CALL API from rhubarb then output result to buffer? Skip file I/O operation would speed up total process.

I found animateWaveFile and main.cpp, It seems the project depend on boost and tools. Maybe it's a little hard to integrate compared with some hearder-only lib.

In theory, it's possible to use Rhubarb as a library. As a matter of fact, if you look into rhubarbLib.h, you'll find a function animateAudioClip that takes an in-memory stream of samples.

In practice, though, you'll first have to integrate Rhubarb into your build process. Rhubarb uses about 16 third-party libraries with Boost just one among them. And even if you did integrate it, you'd only save a fraction of a second -- the time it takes to write a WAVE file to disk and read it back. Processing typically takes several orders of magnitude longer than that. So I doubt you'd get any meaningfull improvement in speed.

@DanielSWolf I have finished first version of intergating Rhubarb. You are right. The processing time is much longer than file I/O, so it's not thing worth to do. So this issue can be closed.

Another issue I created #94 for the effect problem I meet.