htk安装和在matlab里的使用

来源:互联网 发布:淘宝买吃的怎么样 编辑:程序博客网 时间:2024/06/05 07:31

   最近跑代码里头特征提取用到了htk,正好今天汇报了,正好我也无心科研,安个htk吧==正好我又好久没写博客。。。

噢,我win7 64位


HTK安装


1.  当然是下载啦!

 地址:http://htk.eng.cam.ac.uk/

 免费下载啦,不过得先注册下,几秒钟的事儿~


2. 解压

我是解压到‘D:\Program Files\htk’,两文件夹htk 和samples


接下来其实按readme的说明做就行啦!算啦,还是简单写下

3.准备工作

Prerequisites:
    * HTK has been verified to compile using Microsoft Visual Studio.
    * For testing, you will require a Perl interpreter such as
      ActivePerl.  
    * You will need a tool such as 7-zip or winzip (commercial) for unpacking
      the HTK source code archive.
    * It is helpful if you have some familiarity with using the DOS
      command line interface, as you will need to interact with it in
      order to compile, install and run HTK.
    * Ensure that your PATH contains 
      C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
      Or if you are using older versions:
      C:\Program Files\Microsoft Visual Studio\VC98\bin

其实主要就是要安了Microsoft Visual Studio和ActivePerl啦


4.添加环境变量

找到你的Microsoft Visual Studio中bin文件夹的路径,copy一下,比如我的‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin’。

然后到系统属性-高级-环境变量,双击path,加个分号,然后粘贴。ok完毕


5. 运行VCVARS32

在刚刚的bin文件夹里头找到VCVARS32,拷贝到htk文件夹,我的‘D:\Program Files\htk\htk’ 

打开dos命令窗,进到你htk文件目录下,我的依次是:

d: 

cd Program Files

cd htk

cd htk

建一个文件夹等会编译的东西都在里头

mkdir bin.win32

然后就可以运行VCVARS32了

VCVARS32


6.编译

cd HTKLib

nmake /f htk_htklib_nt.mkf all
cd ..(返回上级目录)

 cd HTKTools
 nmake /f htk_htktools_nt.mkf all
 cd ..
  cd HLMLib
nmake /f htk_hlmlib_nt.mkf all
 cd ..
  cd HLMTools
 nmake /f htk_hlmtools_nt.mkf all
 cd ..

安装完成啦~其实还是挺简单的,不造我为啥整了1小时==


7.测试

可以测试下是否真的安装成功

进到刚解压的samples目录,然后:

cd HTKDemo
mkdir hmms
cd hmms
mkdir tmp
mkdir hmm.0
mkdir hmm.1
mkdir hmm.2
mkdir hmm.3
cd ..

mkdir proto
mkdir acc
mkdir test
perl runDemo.pl configs\monPlainM1S1.dcf

结果如下


没问题啦!


matlab里面用system来调用所有的htk指令
我这只用htk提特征,所以只用到HCopy
        command=sprintf('HCopy -A -C %s%s %s%s %s%s',...            eI.CFGPath,eI.config,eI.saveDir,'dmix_temp.wav',...            eI.saveDir, 'train.fea');        system(command);

刚开始跑,出错出错出错!后来发现路径里面有空格所以文件读不进来,比如

eI.CFGPath=‘D:\program files’然后就出错误5010了!百度好久没有资料,最后还是机智的我自己发现的,咩哈哈哈~千万不要有空格!
程序终于顺利跑起来啦,嗨森!

0 0
原创粉丝点击