Home > asr > goGenTcpAndFileCopy4ContentInFilename.m

goGenTcpAndFileCopy4ContentInFilename

PURPOSE ^

Generate fea files and the tcp file for ASR training.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Generate fea files and the tcp file for ASR training.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Generate fea files and the tcp file for ASR training.
0002 
0003 addpath /users/jang/matlab/toolbox/utility
0004 
0005 waveDir='D:\dataSet\digitLetter\2009-ASPR';            % Source directory of all wave files
0006 feaDir='D:\dataSet\digitLetter\2008-ASPR-fea';            % Output directory of feature files
0007 tcpFile='D:\dataSet\digitLetter\2008-ASPR-fea\aspr.tcp';    % Transcription file
0008 mfccCfgFile='\users\jang\app\asr\mfcc\mfcc2.cfg';        % Config file for computing MFCC
0009 
0010 if exist(feaDir)~=7, mkdir(feaDir); end
0011 waveData=recursiveFileList(waveDir, 'wav');
0012 waveNum=length(waveData);
0013 fid=fopen(tcpFile, 'w');
0014 
0015 %for i=1:waveNum
0016 for i=1:10
0017     fprintf('%d/%d: waveFile=%s\n', i, waveNum, waveData(i).path);
0018     [junk, theContent, junk, junk] = fileparts(waveData(i).path);
0019     feaFileName=sprintf('%s\\wn_%06d.fea', feaDir, i);
0020     [junk, feaFileBaseName, junk, junk] = fileparts(feaFileName);
0021     hcopyCmd=sprintf('hcopy.exe -C %s %s %s\n', mfccCfgFile, waveData(i).path, feaFileName);
0022     [hcopyStatus, hcopyResult]=dos(hcopyCmd);
0023     if hcopyStatus~=0
0024         fprintf('Error: hcopy.exe is not executed correctly!\n');
0025         fprintf('%s\n', hcopyResult);
0026     else
0027         fprintf(fid, '%s\t%s\t%s\n', feaFileBaseName, theContent, waveData(i).path);
0028     end
0029 end
0030 
0031 fclose(fid);

Generated on Tue 01-Jun-2010 09:50:19 by m2html © 2003