function speakerSetWrite(speaker, outputDir) if nargin<2, outputDir='.'; end file=[outputDir, '/', speaker.name, '.mfcc']; fid=fopen(file, 'w'); fprintf(fid, '\nMFCC data for speaker id.\n'); fprintf(fid, '\n1.0\n'); feaDim=size(speaker.sentence(1).fea, 1); fprintf(fid, '\n%d\n', feaDim); fprintf(fid, '\n%s\n', speaker.name); sentenceNum=length(speaker.sentence); fprintf(fid, '\n%d\n', sentenceNum); for i=1:sentenceNum frameNum=size(speaker.sentence(i).fea, 2); fprintf(fid, '\n%d\n', i); fprintf(fid, '\n%d\n', frameNum); fprintf(fid, '\n'); for j=1:frameNum for k=1:feaDim fprintf(fid, '%d ', speaker.sentence(i).fea(k,j)); end fprintf(fid, '\n'); end end fclose(fid);