function x=load_param(list,dir); % x=load_param(list,dir); % % loads all the data from a list and a dir to a matrix. % first pass - determine size N=0; files=0; ff=fopen(list,'r'); while (1) ss=fscanf(ff, '%s',[1 1]); if (isempty(ss)) break; end files=files+1; % name=[dir '/features/' ss '.fea']; %disp(name); name=[dir '/' ss]; %disp(name); [m,nSamples,sampPeriod,sampSize,paramKind]=readhtk (name); N=N+nSamples; end fclose(ff); % allocate x = zeros(sampSize/4,N); disp (['reading ',num2str(N),' vectors from ',num2str(files), ' files...']); % 2nd pass - read fil=0; cnt=0; beg=1; ff=fopen(list,'r'); while (1) ss=fscanf(ff, '%s',[1 1]); if (isempty(ss)) break; end name=[dir '/' ss ]; %disp(name); htk=readhtk(name); vecs=size(htk,2); endd = beg+vecs-1; % put it where it belongs x(:,beg:endd) = htk; %disp (vecs); fil=fil+1; cnt=cnt+vecs; % update beg beg = endd+1; end disp('ready');