Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save candlewill/e0e3bce9139de0a058d655ae90807191 to your computer and use it in GitHub Desktop.
Save candlewill/e0e3bce9139de0a058d655ae90807191 to your computer and use it in GitHub Desktop.
merlin install notes
层级 标注格式
声韵母层 p1^p2-p3+p4=p5@p6_p7
. /A:a1_a2-a3_a4#a5
音节层 /B:b1_b2!b3_b4#b5@b6!b7+b8@b9#b10_b11
. /C:c1+c2-c3=c4#c5
词层 /D:d1-d2 /E:e1&e2^e3_e4 /F:f1-f2
韵律层 /G:g1-g2 /H:h1-h2@h3+h4 /I:i1-i2
韵律短语层 /J:j1^j2=j3-j4 /K:k1=k2_k3^k4&k5_k6 /L:l1^l2#l3-l4
语句层 /M:m1#m2+m3+m4!m5
标号 含义
p1 前前基元
p2 前一基元
p3 当前基元
p4 后一基元
p5 后后基元
p6 当前基元在当前音节的位置(正序)
p7 当前基元在当前音节的位置(倒序)

|
a1 | 前一音节的首基元 a2 | 前一音节的末基元 a3,a4 | 前一音节的声调类型 a5 | 前一音节的基元数目 |
b1 | 当前音节的首基元 b2 | 当前音节的末基元 b3,b4 | 当前音节的声调类型 a5 | 当前音节的基元数目 b6 | 当前音节在词中的位置(正序) b7 | 当前音节在词中的位置(倒序) b8 | 当前音节在韵律词中的位置(正序) b9 | 当前音节在韵律词中的位置(倒序) b10 | 当前音节在韵律短语中的位置(正序) b11 | 当前音节在韵律短语中的位置(倒序) |
c1 | 后一音节的首基元 c2 | 后一音节的末基元 c3,c4 | 后一音节的声调类型 c5 | 后一音节的基元数目 |
d1 | 前一个词的词性 d2 | 前一个词的音节数目 |
e1 | 当前词的词性 e2 | 当前词中的音节数目 e3 | 当前词在韵律词中的位置(正序) e4 | 当前词在韵律词中的位置(倒序) |
f1 | 后一个词的词性 f2 | 后一个词的音节数目 |
g1 | 前一个韵律词的音节数目 g2 | 前一个韵律词的词数目 |
h1 | 当前韵律词的音节数目 h2 | 当前韵律词的词数目 h3 | 当前韵律词在韵律短语的位置(正序) h4 | 当前韵律词在韵律短语的位置(倒序) |
i1 | 后一个韵律词的音节数目 i2 | 后一个韵律词的词数目 |
j1 | 前一韵律短语的语调类型 j2 | 前一韵律短语的音节数目 j3 | 前一韵律短语的词数目 j4 | 前一韵律短语的韵律词个数 |
k1 | 当前韵律短语的语调类型 k2 | 当前韵律短语的音节数目 k3 | 当前韵律短语的词数目 k4 | 当前韵律短语的韵律词个数 k5 | 当前韵律短语在语句中的位置(正序) k6 | 当前韵律短语在语句中的位置(倒序) |
l1 | 后一韵律短语的语调类型 l2 | 后一韵律短语的音节数目 l3 | 后一韵律短语的词数目 l4 | 后一韵律短语的韵律词个数 |
m1 | 语句的语调类型 m2 | 语句的音节数目 m3 | 语句的词数目 m4 | 语句的韵律词数目 m5 | 语句的韵律短语数目

Test on ubuntu 16.04. Language: English

Tools: Festival && Merlin

1. download files and copy to merlin/tools

speech_tools

festival

festvox

2. Unzip to merlin/tools

tar -zxvf speech_tools-2.4-release.tar.gz festival-2.4-release.tar.gz festvox-2.7.0-release.tar.gz

3. INSTALL speech tool && festival && festvox

Attention: You can read the INSTALL file in(merlin/tools/festival && /speech_tools && /festvox ) if you failed to install festival

(1)First download Lexicon and put them in corresponding dir( /merlin/tools/festival/lib/dicts )

http://festvox.org/packed/festival/2.4/festlex_CMU.tar.gz

http://festvox.org/packed/festival/2.4/festlex_OALD.tar.gz

http://festvox.org/packed/festival/2.4/festlex_POSLEX.tar.gz

(2) Download test Voice and put them in corresponding dir

http://festvox.org/packed/festival/2.4/voices/festvox_rablpc16k.tar.gz

http://festvox.org/packed/festival/2.4/voices/festvox_kallpc16k.tar.gz

(3) Installation order: speech tool——festival ——festvox

Install Dependent library (as far as I know)

sudo apt-get -y install libncurses5 libncurses5-dev libcurses-ocaml 

Speech tool

cd speech_tools
./configure
make
make test

Festival

cd festival
./configure
make
make test

Festvox

cd festival
./configure
make

4.Set Path

bash ~$ export FESTVOXDIR=/home/awb/projects/festvox/

bash ~$ export ESTDIR=/home/awb/projects/speech_tools/

5.Using Merlin to generate label

There are two ways to generate label file from txt

txt format

( arctic_a0001 "Author of the danger trail, Philip Steels, etc." )

(1) /merlin/misc/scripts/alignment/phone_align

Please read the README.md

(2) merlin/egs/slt_arctic/s1/experiments/slt_arctic_demo/test_synthesis/

create dir /txt which contain txt file

run merlin/egs/slt_arctic/s1/merlin_synthesis.sh and then you can get your own label for synthesis

% Assumptions: vctk is in ~/vctk/VCTK-Corpus.tar.gz
% htk is in ~/htk/HTK-3.4.1.tar.gz
% festival is in ~/festival/festival-2.4-release.tar.gz
% speech_tools is in ~/speech_tools/speech_tools-2.4-release.tar.gz
% sptk is in ~/sptk
% extrafiles from http://festvox.org/packed/festival/2.4/
% festlex_CMU.tar.gz
% festlex_POSTLEX.tar.gz
% festlex_OALD.tar.gz
% festvox_cmu_us_slt_cg.tar.gz
% in ~/fest_extras
% To get VCTK...
% To Festival and HTK
% Festival
% http://festvox.org/packed/festival/2.4/festival-2.4-release.tar.gz
% speech_tools
% http://www.cstr.ed.ac.uk/downloads/festival/2.4/speech_tools-2.4-release.tar.gz
% HTK
% http://htk.eng.cam.ac.uk/download.shtml
% Need a username and password
% mkdir ~/htk
% mkdir ~/festival
% mkdir ~/speech_tools
% mkdir ~/vctk
% FestVox
% http://festvox.org/festvox-2.7/festvox-2.7.0-release.tar.gz
cd ~/speech_tools
tar xzf speech_tools-2.4-release.tar.gz
% ~/speech_tools/speech_tools
cd speech_tools
./configure && make -j 4
% speech_tools are in ~/speech_tools/speech_tools/bin
cd ~/src/merlin/tools
ln -s ~/speech_tools/speech_tools .
cd ~/festival
ln -s ~/speech_tools/speech_tools .
tar xzf festival-2.4-release.tar.gz
cd festival
% multicore make -j 4 gives errors? wtf
./configure && make
cd ~/festvox
tar xzf festvox-2.7.0-release.tar.gz
cd festvox
ESTDIR=~/speech_tools/speech_tools ./configure && make
cd ~/src/merlin/tools
ln -s ~/festvox/festvox .
cd ~/htk
tar xzf HTK-3.4.1.tar.gz
cd htk
# How to pathch, see `INSTALL`
PATCH IT FROM http://hts.sp.nitech.ac.jp/?Download#k7c50de8
sudo apt-get install g++-multilib
./configure --disable-hlmtools --disable-hslab CFLAGS="-DARCH=linux" --prefix=/root/workspace/Programs/HTK &&
make
% files in ~/htk/htk/
cd ~/sptk
tar xzf SPTK-3.9.tar.gz
sudo apt-get install csh
cd SPTK-3.9
mkdir out && ./configure --prefix=`pwd`/out && make && make install
cd ~/fest_extras
tar xzf festlex_CMU.tar.gz
tar xzf festlex_OALD.tar.gz
tar xzf festlex_POSLEX.tar.gz
tar xzf festvox_cmu_us_slt_cg.tar.gz
cp -pr festival ~/festival/festival
cd ~/src/merlin/tools
ln -s ~/sptk/SPTK-3.9/out/bin SPTK-3.9
cd ~/vctk
tar xzf VCTK-Corpus.tar.gz
hts_engine_API-1.10
./configure && make
./configure --with-fest-search-path=/Tmp/kastner/speech_synthesis/festival/examples --with-sptk-search-path=/Tmp/kastner/speech_synthesis/SPTK-3.9/out/bin --with-hts-search-path=/Tmp/kastner/speech_synthesis/htk/HTKTools --with-hts-engine-search-path=/Tmp/kastner/speech_synthesis/hts_engine_API-1.10/bin
cp -pr ~/src/merlin/egs/build_your_own_voice/s1 ~/src/merlin/egs/build_your_own_voice/kks1
cd ~/src/merlin/egs/build_your_own_voice/kks1
ln -s ~/festival/festival ~/src/merlin/tools/festival
ln -s ~/htk/htk ~/src/merlin/tools/htk
bash ./01_setup.sh my_vctk_example
% alignment_script=~/src/merlin/misc/scripts/alignment/state_align/run_aligner.sh
cd ~/src/merlin/egs/build_your_own_voice/kks1/database
ln -s ~/vctk/VCTK-Corpus/txt .
ln -s ~/vctk/VCTK-Corpus/wav48 wav
cd ~/src/merlin/tools
bash compile_tools.sh
cd ~/src/merlin/egs/slt_arctic/s1
bash run_full_voice.sh
sudo apt-get install gawk
cd ~/src/merlin/misc/scripts/vocoder/world/
sed -e 's|merlin_dir=.*|merlin_dir="$HOME/src/merlin"|g' extract_features_for_merlin.sh > extract_features_edit.sh
bash extract_features_edit.sh
cd ~/src/merlin/misc/scripts/alignment/state_align/
mkdir ~/src/merlin/misc/scripts/alignment/state_align/prompt-lab/tmp
bash ./setup.sh
# convert symlinks to hardlinks
cd ~/src/merlin/tools
# Brutal... http://superuser.com/questions/560597/convert-symlinks-to-hard-links
find -type l -exec bash -c 'fi="$(readlink -m "$0")" && rm "$0" && cp -pfr $fi "$0"' {} \;
cd ~/src/merlin/misc/scripts/alignment/phone_align
echo 'export ESTDIR="~/src/merlin/tools/speech_tools"' > source.sh
echo 'export FESTDIR="~/src/merlin/tools/festival"' >> source.sh
echo 'export FESTVOXDIR="~/src/merlin/tools/festvox"' >> source.sh
bash setup.sh
source source.sh && bash ./run_aligner.sh config.cfg
cd ~/src/merlin/misc/scripts/alignment/state_align
echo 'export ESTDIR="~/src/merlin/tools/speech_tools"' > source.sh
echo 'export FESTDIR="~/src/merlin/tools/festival"' >> source.sh
echo 'export FESTVOXDIR="~/src/merlin/tools/festvox"' >> source.sh
echo 'export HTKDIR="~/src/merlin/tools/htk/HTKTools"'> source.sh
bash setup.sh
sed -i -e 's|HTKDIR=.*|HTKDIR='"$HOME"'/kkastner/src/merlin/tools/htk/HTKTools|g' config.cfg
source source.sh && bash run_sligner.sh config.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment