📄 celp.m
字号:
clear;
close all;
% read in speech
filename=input('Please input the name of your speech file formatted with .wav standard=>');
infilename=['./orig/',filename];
outname=['./synthesized/syn_',filename];
[speech,fs,nbits]=wavread(infilename);
speech=resample(speech,8000,fs);
init; % Initialize global variables
% Adjust length to integer number of frames
speech=[speech',zeros(1,frames-mod(length(speech),frames))];
frm_num=length(speech)/frames;
fprintf('\nTotal frame number is %d. %d pts per frame\n',frm_num,frames);
display('Analysis start ...');
for frame_count=1:frm_num
offset=(frame_count-1)*frames;
encoder(speech(offset+1:offset+frames),frame_count); % Encoding routine
if ~mod(frame_count,10)
display(frame_count);
end
end
initdec; % Re-initialize global variables used by decoding routine
display('Synthesis start ...');
[spch_syn]=decoder(frm_num); % Decoding routine
spch_syn=0.5*(spch_syn/max(spch_syn)); % Scale down the output magnitude
wavwrite(spch_syn,outname); % Write sythesized speech to disk with wav format
display('Synthesie complete!');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -