?? viewep.m
字號:
clear all;
fclose('all');
% Fp_Speech=fopen('E:\\已完成的工作\\2001年暑假的工作\\語音\\16k\\M_陳一寧_特定人數(shù)碼采集.dat','r');%打開語音文件 .dat
Fp_Speech=fopen('E:\PiPi_Demo\皮皮\m_牟耕谷_皮皮_wj.seg','r');%打開語音文件 .dat
Fp_EP1=fopen('D:\語音庫\合并的語音庫及程序\file1\F_100_NoName_epd.txt','rt');%打開端點(diǎn)文件 .txt
% Fp_EP1=fopen('E:\\已完成的工作\\2001年暑假的工作\\語音\\16k\\M_陳一寧_特定人數(shù)碼采集_epd.txt','rt');%打開端點(diǎn)文件 .txt
%Fp_EP2=fopen('E:\\已完成的工作\\2001年暑假的工作\\語音\\16k\\M_陳一寧_特定人數(shù)碼采集_epd.txt','rt');
%讀入語音文件總的句子數(shù)
fseek(Fp_Speech,198,'bof');
Sentence_Num=fread(Fp_Speech,1,'int16');
%讀端點(diǎn)文件
tmpS = fscanf(Fp_EP1,'%s',1);
Sentence_Num1 = fscanf(Fp_EP1,'%s',1);
%tmpS = fscanf(Fp_EP2,'%s',1);
%Sentence_Num2 = fscanf(Fp_EP2,'%s',1);
%循環(huán)每一句話
offset_sentence=2; %從第幾句話開始讀語音
%讀入一句話起始端點(diǎn)
for i=0:(offset_sentence-1),
tmppoint = fscanf(Fp_EP1,'%ld',2);
end
for iSentence_Num=offset_sentence:Sentence_Num,
%讀入一句語音數(shù)據(jù)的首地址
fseek(Fp_Speech,200,'bof');
fseek(Fp_Speech,2*4*iSentence_Num,'cof');
Off_Set=fread(Fp_Speech,1,'int32');
%讀入一句語音數(shù)據(jù)的總字節(jié)數(shù)
SentenceLength_Byte=fread(Fp_Speech,1,'int32');
fseek(Fp_Speech,Off_Set,'bof');
%讀入語音數(shù)據(jù)
VoiceData_Short=fread(Fp_Speech,SentenceLength_Byte/2,'int16');
Start1 = fscanf(Fp_EP1,'%ld',1);
%讀入一句話的終止端點(diǎn)
End1 = fscanf(Fp_EP1,'%ld',1);
%讀入一句話起始端點(diǎn)
%Start2 = fscanf(Fp_EP2,'%d',1);
%讀入一句話的終止端點(diǎn)
%End2 = fscanf(Fp_EP2,'%d',1);
x=1:SentenceLength_Byte/2;
x = x %/ 8000;
Start1 = Start1 / 8000;
End1 = End1 / 8000;
y=(-5000):20:(5000);
%畫圖
plot(x,VoiceData_Short,'g');
hold on;
plot(Start1,y,'r-',End1,y,'r-');
axis('tight');
hold off;
string=int2str(iSentence_Num);
title(string);
%VoiceData_Short=VoiceData_Short/32768;
%wavwrite(VoiceData_Short,8000,string);
pause;
end
fclose('all');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -