wiki:HMMVoiceCreation

Version 12 (modified by marcela_charfuelan, 17 years ago) (diff)

--

Voice Import Tools Tutorial : How to build a HMM-based voice for the MARY platform

For creating HMM-based voices we use a version of the speaker dependent training scripts provided by HTS that was adapted to the MARY platform. The steps for building a HMM voice for the MARY platform can be summarised in:

I) Checking the necessary programs and files
II) Data preparation
III) Training of HMM models
IV) Adding a new HMM voice in the Mary system.
V) Creating other voice in German or English (if you want to train HMMs with another speech database).

The previous steps will be explained below creating a HMM voice using the HTS speaker dependent training demo.

For an explanation on how to create an adapted HMM voice using the speaker adaptation/adaptive training demo please see HMMVoiceCreationAdapt.

The training scripts used here are the latest versions, that is, it is required HTS_2.0.1 and SPTK-3.1. Some scripts have been added-modified to:

  • Use MARY instead of festival as text analyzer.
  • Train bandpass voicing strengths for mixed excitation.
  • Process language specific settings as parameters.

I) Checking the necessary programs and files:

MARY requirements:

HTS requirements, please download and follow the instructions for installing:

Other requirements, please download and follow the instructions for installing:

0.1) download and un-zip, un-tar the latest speaker dependent training demo for English.

http://hts.sp.nitech.ac.jp/archives/2.0.1/HTS-demo_CMU-ARCTIC-SLT.tar.bz2 for HTS-2.0.1

0.2) download and unzip the patch file for using MARY instead of Festival as text analyser.

https://mary.opendfki.de/repos/trunk/lib/hts/HTS-2.0.1-demo_CMU-ARCTIC-SLT_for_Mary-3.6.patch.zip

apply the patch to the HTS-demo_CMU-ARCTIC-SLT directory:

   patch -p1 -d . < HTS-2.0.1-demo_CMU-ARCTIC-SLT_for_Mary-3.6.patch

0.3) create a wav directory.

0.4) Run the VoiceImport program

First of all you need to set your MARY_BASE directory and then run the program:

   export MARY_BASE="/dir/to/openmary"
   java -jar -Xmx1024m  $MARY_BASE/java/voiceimport.jar

If you are not familiar or have problems with the VoiceImport program, please read and follow the instructions in the Voice Import Tools Tutorial: http://mary.opendfki.de/wiki/VoiceImportToolsTutorial

If you want to create another voice in German or English please see the section V below.

Please remember that whenever you are in doubt about the settings of a particular component you can check its corresponding help for a description of the meaning (and possible values) of each variable.

II) Data preparation:

1- Run the HMMVoiceDataPreparation of the HMM Voice Trainer group to check if text, wav and data/raw files are available and in the correct paths. If just data/raw is provided, the program will do the conversion. If no text files are available but data/utts in festival format, the program will do the conversion as well.

2- Run the PhoneUnitFeatureComputer component of the Feature Extraction group to extract context feature vectors from the text data. This procedure will create a "phonefeatures" directory. For running this component the MARY server should be running as well.

3- Run the EHMMlabeler component of the Automatic Labeling group to label automatically the wav files using the corresponding transcriptions. This procedure might take several hours. For running EHMMLabeler, please use the settings editor of this component to set, according to your festvox installation, the variable:

   EHMMLabeler.ehmm  = ../festvox/src/ehmm/bin/

4- Run the LabelPauseDeleter component of the Automatic Labeling group. Please use the settings editor of this component to set the variable:

   LabelPauseDeleter.threshold  =  10

5- Run the PhoneUnitLabelComputer component of the Labels and Pause Correction group. This procedure will create a "phonelab" directory.

6- Run the PhonelabelFeatureAligner component of the Labels and Pause Correction group. This procedure will verify alignment between "phonefeatures" and "phonelabels".

III) HMM models training:

7- Run the HMMVoiceConfigure component of the HMM Voice trainer group, the default setting values of this component are already fixed for the HTS-demo_CMU-ARCTIC-SLT voice.

If running configure for other voice, for example a male German voice, please use the settings editor of this component to set the variables:

  HMMVoiceConfigure.dataSet      =  german_set_name
  HMMVoiceConfigure.featureList  =  feature_list_de.pl  (the set of context features used for this voice can be change in this file).
  HMMVoiceConfigure.speaker      =  speaker_name 
  HMMVoiceConfigure.lowerF0      =  40  (male=40,  female=80)  
  HMMVoiceConfigure.upperF0      =  280 (male=280, female=350)
  HMMVoiceConfigure.voiceLang    =  de

Using the settings editor of this component you can also change other variables like using LSP instead og MGC, sampling frequency, etc., the same as you would do when running "make configure + parameters" with the original HTS scripts.

8- Run the HMMVoiceMakeData component of the HMM Voice trainer group to run the HTS procedure "make data". This procedure is the same as in the original scripts with additional sections for calculating strengths (for mixed excitation), global variance, and handling of MARY context features.

Particular procedures can be repeated isolated fixing the particular settings for this component. For example, if the procedure that creates strengths (in the str directory) has to be repeated with a different set of filters (data/filters/), please remove the old str directory and set:

  HMMVoiceMakeData.makeSTR       =  1
  HMMVocieMakeData.makeCMPMARY   =  1

all the other variables in 0, and run again the component. (In this case you need to run as well makeCMPMARY because you need to compose again the vectors mgc+lf0+str).

The procedures can be repeated manually as well, going to the data directory and running "make data" or "make str", as is normally done with the original HTS scripts.

NOTE: the Makefile in data/ includes a gv: section copied from HTS-2.1alpha version to calculate global variance files. In MARY, these files are generated little endian and contain a header of size one short to indicate the size of the vectors it contains.

9- Run the HMMVoiceMakeVoice component of the HMM Voice trainer group, here again particular training steps can be repeated selecting them (setting in 1, all the others in 0) from the settings of this component. This is equivalent to run again:

   perl scripts/Training.pl scripts/Config.pm

after modifying the Config.pm file, as is normally done with the original HTS scripts. This component will generate general information about the execution of the training steps. Detailed information about the training status can be found in the logfile in the current directory.

The training procedure can take several hours, please check the log file time to time to check progress.

IV) Adding a new voice in the MARY platform:

10- Run the HMMVoiceInstaller component of the Install Voice group. The default setting values of this component are already fixed for the HTS-demo_CMU-ARCTIC-SLT voice. If you are training other voice please use the settings editor of this component to set:

  HMMVoiceInstaller.FeaList     =  data/feature_list_xx.pl 
                                   make sure that this file is the one used during training, xx=en for English or xx=de for German.
  HMMVoiceInstaller.Flab        =  data/labels/gen/xx.lab 
                                   this is an example of a label file in HTSCONTEXT format for synthesise during start-up. 
  HMMVoiceInstaller.useMixExc   =  true
                                   set this variable to true if using mixed excitation
  HMMVoiceInstaller.useGV       =  true 
                                   set this variable to true if using global variance in parameter generation.

The VoiceInstaller will:

  • Create a new mary config file in: $MARY_BASE/conf/german-hmm-voice.config
  • Add the files corresponding to this voice in: $MARY_BASE/lib/voices/hmm-voice/
  • copy features list: data/feature_list_en.pl to $MARY_BASE/lib/voices/hmm-voice
  • copy one example of phonelab for testing the synthesiser: data/labels/gen/gen_cmu_us_arctic_slt_xxxx.lab to $MARY_BASE/lib/voices/hmm-voice
  • copy the HTS trees: voices/qst001/ver1/*.inf to $MARY_BASE/lib/voices/hmm-voice
  • copy the HTS PDF models: voices/qst001/ver1/*.pdf to $MARY_BASE/lib/voices/hmm-voice
  • copy global variance models (if useGV is set to true): data/gv/gv-*-littend.pdf to $MARY_BASE/lib/voices/hmm-voice
  • copy filter taps for mixed excitation: data/filters/mix_excitation_filters.txt to $MARY_BASE/lib/voices/hmm-voice

After successfully installing a new voice, it can be used with the mary_server and the mary_client.

V) Creating other voice in German or English.

If using German:

For creating a new German voice it is necessary:

  • a wav or raw directory with the speech files you will use for training the German voice.
  • transcriptions of the files, one text file per speech file, or transcriptions in festival format if available.

Then we use as a base the original HTS-demo_CMU-ARCTIC-SLT directory:

  • Download and un-zip, un-tar the HTS-demo_CMU-ARCTIC-SLT for HTS-2.0.1
  • Rename this directory as your new voice name, for example german_voice, and delete the directories data/raw and data/utt.
  • Apply the MARY patch to the german_voice directory.
    patch -p1 -d . < HTS-2.0.1-demo_CMU-ARCTIC-SLT_for_Mary-3.5.0.patch
  • Move your speech files to this directory, if you have a wav directory, this should be copied in the current directory (german_voice/wav). If you have a raw directory, this should be copied in the data directory (german_voice/data/raw).
  • Move your transcription files to this directory, if you have a text directory containing the transcription of each file in separate files, this should be copied in the current directory (german_voice/text). If you have transcriptions in festival format please copy this directory in the data/utts directory (german_voice/data/utts/).
  • Now run the VoiceImport program and follow the instructions as normal. Provide general settings for:
       db.gender    =  male  (or female)
       db.locale    =  de
       db.marybase  =  /path/to/mary/base/
       db.voicename =  german_voice
    



Marcela Charfuelan
DFKI - Fri May 9 11:54:00 CEST 2008