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