DanielSWolf / rhubarb-lip-sync

Rhubarb Lip Sync is a command-line tool that automatically creates 2D mouth animation from voice recordings. You can use it for characters in computer games, in animated cartoons, or in any other project that requires animating mouths based on existing recordings.
Other
1.71k stars 208 forks source link

Set up the path of "res" #114

Open b4zz4 opened 2 years ago

b4zz4 commented 2 years ago

I have trouble creating the arch package.

Simple make:

cd build
cmake ..
make rhubarb

For example:

rhubarb -o output.txt audio.wav 

I don't know how to correctly configure the path to "res/": [Error] "acmod.c", line 82: Folder '/usr/local/bin/res/sphinx/acoustic-model' does not contain acoustic model definition 'mdef'

DanielSWolf commented 2 years ago

Rhubarb requires a number of resource files. It looks for them in a res directory which must be in the same directory as the rhubarb executable.

Judging by the error message, the rhubarb executable is in /usr/local/bin. Is that correct? If so, how did you create it there? Is it a copy, a symlink, or a hard link to the actual file?

b4zz4 commented 2 years ago

Isn't there a way to configure that PATH during the compilation?

DanielSWolf commented 2 years ago

No. Why would you hard-code a file path in a binary?

Judging by the error message, the rhubarb executable is in /usr/local/bin. Is that correct? If so, how did you create it there? Is it a copy, a symlink, or a hard link to the actual file?

b4zz4 commented 2 years ago

Sorry for my English.

But, I think the models should be in share, but it looks for them in "/usr/local/bin/res/sphinx/acoustic-model". I don't know how to change this during the compilation.

DanielSWolf commented 2 years ago

"Compilation" is the act of taking source code and creating a binary executable file. This executable file should then be able to run from any directory and on any machine with a matching operating system. So hard-coding a path during compilation is just plain wrong.

After compilation, the next step is deployment. That's the act of taking the executable file and any other required files and copying them to a directory where you can then run them. Deployment is machine-specific.

It seems to me that you're confusing these two concepts.

Why does the executable end up in your /usr/local/bin directory? After compilation, it should reside in a subdirectory of build within the source code repository. It seems to me that you're performing some kind of local deployment that goes wrong.

BTW, why do you build using make? The expected calls should look something like this:

cmake .. -G Xcode
cmake --build . --config Release --target package