[tts] 基于HMM和单元拼接的tts

基于HMM和单元拼接的tts

HTS

官方demo
数据准备转换图

由于之前做merlin的时候用的是wav文件,官方的demo中是raw文件,所以做了一点改动。把/data/Makefile.in中的feature:中的全部屏蔽掉,自己生成后续需要的bap/*.bapmgc/*.mgclf0/*.lf0文件。
生成的方法就是借用merlin的脚本

merlin/misc/scripts/vocoder/world/extract_features_for_merlin.sh

但是直接运行会出问题,需要修改一些参数。主要是nFFTHalf and alpha这两个参数,merlin自带的会比hts的大,直接运行的时候,在Training阶段会出现HMM跳过了的情况,就导致有些文件缺失了。
对应一下hts和merlin的参数。我的wav是16kHz的,所以我只关注这个。

if [ "$fs" -eq 16000 ];then
    nFFTHalf=1024 
    alpha=0.42		#merlin use 0.58
fi

unit selection

单元选择这个我没有实际搭出来,原因是speech_tools这个工具一直不能正确安装。在make时一直报libeststring.so这个文件缺失,但是在我PATH的lib中是存在这个文件的,而且版本和对应的系统型号都是没问题,就是一直过不去。有大神路过的话,求指教。

gcc -shared -o -fPIC libeststring.so.1.2 shared_space/*.o  $libs
gcc: 错误:libeststring.so.1.2:没有那个文件或目录
make[1]: *** [libeststring.so] 错误 1
make: *** [lib] 错误 2

虽然没完成搭建,但是验证了资源的大部分,能够确定资源是靠谱的,mark下。

https://github.com/CSTR-Edinburgh/CSTR-Edinburgh.github.io/blob/master/_posts/2016-8-21-Multisyn_unit_selection.md
http://www.speech.zone/exercises/build-a-unit-selection-voice/

我就是卡在了10. Calculate duration,因为这步需要speech_tools这个工具。

小坑记录

在使用HTK3.4时,很多地方会告诉你这里存在一个Bug,让你修改。

Fixing HTK Source

In the htk directory, navigate to htk/HTKLib, and open the file HRec.c in a plain text editor. Find the line 1650 which reads

if (dur<=0 && labid != splabid) HError(8522,"LatFromPaths: Align have dur<=0 ");
labid in this line should be changed to labpr. It should look like this:

if (dur<=0 && labpr != splabid) HError(8522,"LatFromPaths: Align have dur<=0 ");

这一步是先修改source code ,然后 ./configure make && make install

Reference

http://www.speech.zone/exercises/build-a-unit-selection-voice/
https://github.com/CSTR-Edinburgh/CSTR-Edinburgh.github.io/blob/master/_posts/2016-8-21-Multisyn_unit_selection.md
http://blog.sina.com.cn/s/blog_790a12750100z32p.html
http://shartoo.github.io/merlin-tts/ (这篇有点误导,其实和merlin没啥关系,写的是unit select的东西)

原文地址:https://www.cnblogs.com/zhanxiage1994/p/7828668.html