0001 function word=wordQiYinBgPlot(cmObj, fs, minY, maxY)
0002
0003
0004
0005
0006
0007
0008 if nargin<1; selfdemo; return; end
0009
0010 word=cmWordBgPlot(cmObj, fs, minY, maxY);
0011
0012 for i=1:length(word)
0013 if strcmp(word(i).name, 'sil') | strcmp(word(i).name, 'sp');
0014 set(word(i).textH, 'string', '');
0015 else
0016 set(word(i).textH, 'string', word(i).name);
0017 set(word(i).patchH, 'faceColor', 0.5*[1 1 1]);
0018 end
0019 for j=1:length(word(i).phone)
0020 phoneName=word(i).phone(j).name;
0021 plusPos=findstr(phoneName, '+');
0022 phoneName=phoneName(1:plusPos-1);
0023 set(word(i).phone(j).textH, 'string', phoneName);
0024
0025 if isUnvoicedPhone(phoneName, 'hanyu')
0026 index=word(i).phone(j).time*fs/10000000;
0027 word(i).phone(j).patchH=patch(index([1 2 2 1])/fs, [minY minY maxY maxY], 0.8*[1 1 1]);
0028 set(word(i).phone(j).patchH, 'edgeColor', 'k');
0029 end
0030 end
0031 end
0032 axis([-inf inf minY, maxY]);
0033
0034
0035 function selfdemo
0036 wavFile='朝辭白帝彩雲間.wav';
0037 wavFile='但使龍城飛將在.wav';
0038 cmFile=[wavFile(1:end-3), 'cm'];
0039 [wave, fs, nbits]=wavread(wavFile);
0040 feval(mfilename, cmFile, fs, -1, 1);
0041 time=(1:length(wave))/fs;
0042 waveH=line(time, wave);
0043 axis([min(time), max(time), -1, 1]);
0044 box on