Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making the .flitevox voices from source? #6

Open
thebunnyrules opened this issue Jan 10, 2018 · 16 comments
Open

making the .flitevox voices from source? #6

thebunnyrules opened this issue Jan 10, 2018 · 16 comments

Comments

@thebunnyrules
Copy link

Hi guys, great great project. These voices are really amazing.

I've built flite 2.1 from source (probably one of the smoothest builds I've had in Linux) but I noticed that the .flitevox voices need to be downloaded instead of built from source?

I was wondering what the procedure for building these voices is and where I can find the source code?

@saikrishnarallabandi
Copy link
Collaborator

saikrishnarallabandi commented Mar 4, 2018

Hi,

Sorry for the delay in response. flitevox voices can be built. I am assuming that you mean from a festival voice directory when you say source.

The following are set of commands to build a flite voice from existing festival voice directory:

$FLITEDIR/tools/setup_flite
./bin/build_flite
cd flite
make

If you also want to dump the voice,
make voicedump
make add_feats

An example script which has these is build_cg_rfs_voice (It should be in the bin directory)

Hope this helps!

@thebunnyrules
Copy link
Author

@saikrishnarallabandi thanks so much for the reply. sorry I didn't answer before now. I must have missed github's email notification.

I've tried to follow your directions but I'm a little new at this and there's a couple of points I'm confused about.

$FLITEDIR/tools/setup_flite

By FLITEDIR, do you mean the flite2.1 source code master dir that I clone from github? I'm asking because I compiled and installed flite2.1 but there was no tools folder in the final install prefix. On the other hand, there is a tools folder in the source code directory with a setup_flite script and there is a bin folder with a build_flite binary that appears after the make step in compilation. Are you referring to that in your ./bin/build_flite step? I just want to make sure that my assumptions are correct here and that you're not referring to something else.

am assuming that you mean from a festival voice directory when you say source.

I found a couple of sources: for this build I'm trying to build cmu_us_fem (the us english with german accent). I found a source for it in the festival arctic section found in: http://festvox.org/cmu_arctic/packed/cmu_us_fem_arctic.tar.bz2 (the one with /etc/txt.done.data and /wav/arctic_a000x.wav files). I also found http://festvox.org/packed/festival/2.5/voices/festvox_cmu_us_fem_cg.tar.gz.

I tried your procedure with both of these sources, setting "export FLITEDIR=git0cloned-flite2.1-sourcefolder-with-compiled-binaries" and "export ESTDIR=cloned-speech_tools-sourcefolder-with-compiled-binaries"

When I used $FLITEDIR/tools/setup_flite on extracted festvox_cmu_us_fem_cg.tar.gz folder, script said that it was missing the /wav dir. When I tried it on cmu_us_fem_arctic.tar.bz2's extracted folder, I got this error message:

Can't find etc/voice.defs file
don't know what voice to convert
Setup for conversion of to flite FAILED

Do I have the wrong source files? Or is there a step I'm missing or did wrong?

@saikrishnarallabandi
Copy link
Collaborator

Hi,

Saw this just now. sorry. Lets start with this directory you downloaded: http://festvox.org/cmu_arctic/packed/cmu_us_fem_arctic.tar.bz2

Once you extract, you can create the voice specific variables by running the following:

#Setup Voice directory
$FESTVOXDIR/src/clustergen/setup_cg cmu us fem

Ignore the warning and let it populate the folders. Now, you should be able to see the binaries in bin/

Running those shoud suffice. Let me know if there is some issue .

@thebunnyrules
Copy link
Author

thebunnyrules commented Apr 26, 2018

Hello,

I feel like I'm really close but it's still giving me some errors close to the last step.
so this is what I have been able to put together from your instructions so far:

Short version:
build flite, build speech tools, build festival (this wasn't in your instructions but it solved an error I was getting during the ./bin/build_flite step), build festvox, extract cmu_us_fem_arctic.tar.bz2 and go to extracted folder, $FESTVOXDIR/src/clustergen/setup_cg cmu us fem, $FLITEDIR/tools/setup_flite, ./bin/build_flite, cd flite, make

Long version:

#Get source for flite, festvox, speech tools, festival and a voice from here http://festvox.org/cmu_arctic/packed (for this example: http://festvox.org/cmu_arctic/packed/cmu_us_fem_arctic.tar.bz2)

#the paths will vary on your PC. replace the paths below with the ones you're using.

#goto flite-master dir (flite source code) and
export FLITEDIR=/home/ubuntu/Desktop/festival-tests/flite
cd $FLITEDIR; ./configure; make

#goto speech_tools master dir and
export ESTDIR=/home/ubuntu/Desktop/festival-tests/speech_tools
cd $ESTDIR; ./configure; make

#goto festival dir (seems to be needed during voice build)
export FESTIVALDIR=/home/ubuntu/Desktop/festival-tests/festival
cd $FESTIVALDIR; ./configure; make; make default_voices
 
#goto festvox master dir and
export FESTVOXDIR=/home/ubuntu/Desktop/festival-tests/festvox
cd $FESTVOXDIR; ./configure; make

#goto downloaded voice, extract, goto dir:
cd /home/ubuntu/Desktop/festival-tests/cmu_us_fem_arctic
$FESTVOXDIR/src/clustergen/setup_cg cmu us fem
$FLITEDIR/tools/setup_flite
./bin/build_flite
cd flite
make

#If you also want to dump the voice,
make voicedump
make add_feats

Errors:

During the ./bin/build_flite step (for some reason it's sliping a // into the paths it's looking into)

ubuntu@ubuntu:~/Desktop/festival-tests/cmu_us_fem_arctic$ ./bin/build_flite
cg_convert: finding parameter ranges
Error reading ESPS file festival/trees/cmu_us_fem_mcep*.params
cat: etc/f0.params: No such file or directory
Error reading ESPS file /home/ubuntu/Desktop/festival-tests/cmu_us_fem_arctic//festival/trees/cmu_us_fem_mcep.params
Cannot load track: /home/ubuntu/Desktop/festival-tests/cmu_us_fem_arctic//festival/trees/cmu_us_fem_mcep.params
SIOD ERROR: could not open file /home/ubuntu/Desktop/festival-tests/cmu_us_fem_arctic//festival/trees/cmu_us_fem_mcep.tree
flite_build cg complete.  You can compile the generated voice by
   cd flite; make

during the: cd flite; make step (probably because the preceding step had failed):

cd flite; make
ls: cannot access 'cmu_us_fem_cg_*_f0_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_mcep_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_params.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_durmodel.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_f0_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_mcep_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_params.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_durmodel.c': No such file or directory
make: *** No rule to make target 'paramfiles.mak'.  Stop.

@saikrishnarallabandi
Copy link
Collaborator

Oh sorry. Can you build the festvox voice and then get to flite voice? I assumed you had that voice already.

Here are the steps to build:
( after putting txt.done.data in the folder 'etc' and copying the wavefiles to 'wav'

Some text processing

./bin/do_build build_prompts etc/txt.done.data
./bin/do_build label etc/txt.done.data
./bin/do_clustergen parallel build_utts etc/txt.done.data
./bin/do_clustergen generate_statenames
./bin/do_clustergen generate_filters

Extract acoustic features

./bin/do_clustergen parallel f0_v_sptk
./bin/do_clustergen parallel mcep_sptk
./bin/do_clustergen parallel str_sptk
./bin/do_clustergen parallel combine_coeffs_me
cp festvox/clustergen.scm festvox/clustergen.scm.xxx
cat festvox/clustergen.scm.xxx |
sed 's/mixed_excitation nil/mixed_excitation t/' |
cat >festvox/clustergen.scm

Make train test split

./bin/traintest etc/txt.done.data

Train a model

./bin/do_clustergen parallel cluster etc/txt.done.data.train
./bin/do_clustergen dur etc/txt.done.data.train

Now do the flite.

It should take an hour to finish this.

@thebunnyrules
Copy link
Author

thebunnyrules commented Apr 26, 2018

Sure, no problem. I'll give that a go. Should I do these steps before before I do the step with:
$FESTVOXDIR/src/clustergen/setup_cg cmu us fem
or after?

@saikrishnarallabandi
Copy link
Collaborator

After.

$FESTVOXDIR/src/clustergen/setup_cg cmu us fem

sets up the folder structure.

@thebunnyrules
Copy link
Author

thebunnyrules commented Apr 30, 2018

Hi Sai Krishna,

I followed your instructions but still got this error at the end:

cd flite; make #gives these errors:
ls: cannot access 'cmu_us_fem_cg_*_f0_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_mcep_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_params.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_durmodel.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_f0_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_mcep_trees.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_params.c': No such file or directory
ls: cannot access 'cmu_us_fem_cg_*_durmodel.c': No such file or directory

When I downloaded this file: http://www.festvox.org/packed/festival/2.5/voices/festvox_cmu_us_fem_cg.tar.gz and put the contents of contents of <festvox_cmu_us_fem_cg.tar.gz>/festival/lib/voices/us/cmu_us_fem_cg into the directory where I was building the voices and re-did:

./bin/build_flite; cd flite; make

it succeeded. This is great but festvox_cmu_us_fem_cg.tar.gz is a packed version of the voice with a bunch of param binaries in it. I'm try to do everything from source. Do you know how I can go about generating these files?

<festvox_cmu_us_fem_cg.tar.gz>
files that I have not been able to generate so far:

festvox/cmu_us_fem_dur.scm
dur_rf_models/mlist
dur_rf_models/dur_14/cmu_us_fem_durdata_cg.scm
dur_rf_models/dur_08/cmu_us_fem_durdata_cg.scm
dur_rf_models/dur_01/cmu_us_fem_durdata_cg.scm
rf_models/mlistf0
rf_models/trees_14/cmu_us_fem_f0.tree
rf_models/trees_13/cmu_us_fem_f0.tree
rf_models/trees_10/cmu_us_fem_f0.tree
rf_models/mlist
rf_models/trees_09/cmu_us_fem_mcep.params
rf_models/trees_09/cmu_us_fem_mcep.tree
rf_models/trees_09/cmu_us_fem_f0.tree
rf_models/trees_06/cmu_us_fem_mcep.params
rf_models/trees_06/cmu_us_fem_mcep.tree
rf_models/trees_06/cmu_us_fem_f0.tree
rf_models/trees_19/cmu_us_fem_mcep.params
rf_models/trees_19/cmu_us_fem_mcep.tree
rf_models/trees_19/cmu_us_fem_f0.tree
festival/trees/cmu_us_fem_mcep.params
festival/trees/cmu_us_fem_mcep.tree
festival/trees/cmu_us_fem_f0.tree

This is a list of the files I was able to generate in the absence of festvox_cmu_us_fem_cg.tar.gz : https://pastebin.com/ysgZk9pg

@saikrishnarallabandi
Copy link
Collaborator

This uses Random Forests.

./bin/build_cg_rfs_voice should build those dependencies.

( It will run for around 12-15 hours depending on the config)

@thebunnyrules
Copy link
Author

thebunnyrules commented May 1, 2018

Hey, before we continue, I just want to say thank you. You've really gone out of your way to help me and I really appreciate that.

At very bottom of this comment is my updated recipe for building a voice. At what point should I use ./bin/build_cg_rfs_voice in these steps? I've tried to do it after the ./bin/do_clustergen dur etc/txt.done.data.train step but it crashes after an hour. I'm going to play around with my setup and see if I can fix the errors on my own. I'll get back to you later on when I have a clearer picture.

Updated Voice Building Recipe

(skipping the tool building steps for the sake of brevity)

#Do text processing
./bin/do_build build_prompts etc/txt.done.data
./bin/do_build label etc/txt.done.data
./bin/do_clustergen parallel build_utts etc/txt.done.data
./bin/do_clustergen generate_statenames
./bin/do_clustergen generate_filters

#Extract acoustic features
./bin/do_clustergen parallel f0_v_sptk
./bin/do_clustergen parallel mcep_sptk
./bin/do_clustergen parallel str_sptk
./bin/do_clustergen parallel combine_coeffs_me
cp festvox/clustergen.scm festvox/clustergen.scm.xxx;cat festvox/clustergen.scm.xxx | sed 's/mixed_excitation nil/mixed_excitation t/' > festvox/clustergen.scm

#Make train test split
./bin/traintest etc/txt.done.data

#Train a model
./bin/do_clustergen parallel cluster etc/txt.done.data.train
./bin/do_clustergen dur etc/txt.done.data.train

#Now do the flite.
$FLITEDIR/tools/setup_flite
./bin/build_flite
cd flite; make

#If you also want to dump the voice,
make voicedump
make add_feats

@thebunnyrules
Copy link
Author

Sai Krishna, in your first post, you said to that after I succeed in making a voice dump (make voicedump), I can use the command "make add_feats" to add feats. As, I had stated above, using the CMU generated files found in festvox_cmu_us_fem_cg.tar.gz, I succeed in generating a voice but I forgot to mention that when I tried to do the "make add_feats" command after generating the voicedump, I got this error: "make: *** No rule to make target add_feats. Stop." I've tried using rgrep to search all the source and config files in festival,festvox,flite and speech_tools for the add_feats command and I couldn't find it. Maybe it's been renamed to something new? Do you have any suggestions?

@saikrishnarallabandi
Copy link
Collaborator

saikrishnarallabandi commented May 4, 2018 via email

@thebunnyrules
Copy link
Author

I've aleardy done this several times (rebuilt voice and tools from sctach). At no point is add_feats available.

@Pranav-Jain
Copy link

Hi,
I am running into error in the final step to create voices using flite and I hope you would help.
I have successfully trained the model and then followed the following steps.
$FLITEDIR/tools/setup_flite
./bin/build_flite
cd flite; make
The final make command works great.

But finally, when I try to run the binary created by the "make" to create voices from a given text, I run into a segmentation fault.

@Brajkishore-ai
Copy link

./bin/do_build build_prompts etc/txt.done.data

Hi, While running the do_build I am getting the belo error.

SIOD ERROR: could not open file /projects/festival/lib/dicts/cmu/cmulex.scm
closing a file left open: ./festvox/indic_lexicon.scm
closing a file left open: ./festvox/cmu_indic_guj_lexicon.scm
closing a file left open: festvox/cmu_indic_guj_clunits.scm
closing a file left open: festvox/build_clunits.scm

I am not able to find the cmulex.scm file due to which the error is occuring. I am running this file from the voice folder that I have downloaded and extracted. Can you please provide a solution to this or any suggestion to solve this issue.
Thank you

@awbcmu
Copy link
Collaborator

awbcmu commented Sep 29, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants