m2_ww3.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 131 行
M
131 行
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% m2_ww3.m
%
% callback for window-display pushbutton 3 for m1
%
% INSERT SILENCE
%
% jmw
% 7/22/94
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (~isempty(ww3_h))
;
% do nothing, window is already open
return;
else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% do following ONLY if window was just opened
% initialize window:
ww3_height = 250;
ww3_width = 700;
if (isempty(ww3_saved_position))
ww3_h=figure('Position',[50 100 ww3_width ww3_height],...
'Numbertitle','off','Name',...
'Insert Silent Segment' ,'Resize','on',...
'Color',BACK_COLOR);
else
ww3_h=figure('Position',ww3_saved_position,'Numbertitle','off',...
'Name','Insert Silent Segment','Resize','on',...
'Color',BACK_COLOR);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add 'OK' function button
ww3_pb_ok_h=uicontrol('Position',[20 ww3_height-50 60 30],'String','OK',...
'Callback','ww3_ok');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add 'Update' function button
ww3_pb_update_h=uicontrol('Position',[110 ww3_height-50 60 30],...
'String','Update','Callback','ww3_upd','Visible', 'off');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add 'Cancel' function button
ww3_pb_cancel_h=uicontrol('Position',[200 ww3_height-50 60 30],...
'String','Cancel','Callback','ww3_can','Visible', 'off');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% slider & edit window to control/display length of inserted silent segment
ww3_s_length_h=uicontrol('Position',[200 ww3_height-130 450 20],...
'Style','Slider','Callback','ww3_s_le', 'Max',5000,...
'Value', sil_length);
ww3_e_length_h=uicontrol('Position',[140 ww3_height-130 50 20],...
'Style','Edit', 'String', sprintf('%6.1f', sil_length/10));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% slider & edit window to control/display start point of inserted silent segment
maxx = length(tmp_residue);
maxx = 1000 * ceil(maxx/1000);
ww3_s_start_h=uicontrol('Position',[200 ww3_height-200 450 20],...
'Style','Slider','Callback','ww3_s_st', 'Max',maxx,...
'Value', silstart);
% match with closest frame start point ...
x= abs(tmp_range(:,1) - silstart );
[sort_x, indx_x]=sort(x);
silstart = tmp_range(indx_x(1));
% now, match with closest segment start point
x= abs(tmp_seg_range(:,1) - silstart );
[sort_x, indx_x]=sort(x);
silstart = tmp_seg_range(indx_x(1));
ww3_e_start_h=uicontrol('Position',[140 ww3_height-200 50 20],...
'Style','Edit', 'String', sprintf('%5.0f', silstart));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add text labels
axis([0 1 0 1]);
text('Units','Pixels','Position',[ -70 ww3_height-145] ,'String',...
'silence duration',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -30 ww3_height-158] ,'String',...
'(ms)',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -50 ww3_height-215] ,'String',...
'insert point',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -50 ww3_height-228] ,'String',...
'(sample #)',...
'color',TEXT_COLOR);
axis off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end; % end ~isempty(ww3_h)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% clean up time
clear maxx
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?