formant_main.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 98 行

M
98
字号
%Callback function for the formant specifications button
%
% Author Karthik


%Similar to source menu interface
if exist('excitation') == 0   %No excitation has been specified
   PV = [436 204 244 81];
   s2 = 'No excitation specified';
   message_fig = figure('Position',PV,...
      'Numbertitle','off',...
      'Color',[0.5 0.5 0.5],...
      'Name',s2);
   uicontrol('Style','Frame',...
      'Units','Normalized',...
      'Position',[0.05 0.05 0.9 0.9],...
      'BackGroundColor',[0.9 0.9 0.9]);
   
   uicontrol('Style','text',...
      'Units','Normalized',...
      'Position',[0.1 0.2 0.8 0.4],...
      'ForegroundColor','red',...
      'BackGroundColor',[0.9 0.9 0.9],...
      'String','No excitation specified.Please do so now');
   
   pause(3);
   close(message_fig);
   clear message_fig;
   source_main;
else
   segment_no = 1;
   bg_color = [0.8 0.8 0.8];
   % Set position and size of analysis window
   PV = [38 39 173 228];
   s2 = 'Formant Menu';
   % Open analysis window
   while exist('formant_fig_1')==1
      try1 = 'get(formant_fig_1,''position'');';
      eval(try1,catch2);
      if check ==0
         clear formant_fig_1;
         check = 1;
         break;
      end
      s1 = get(formant_fig_1,'Name');
      if ~strcmp(s1,s2)
         clear formant_fig_1;
         break;
      end
      figure(formant_fig_1);
      break;
   end;
   if exist('formant_fig_1')~=1;
      formant_fig_1=figure('Position',PV,...
         'Resize','off',...
         'Numbertitle','off',...
         'Color',[0.5 0.5 0.5],...
         'Name',s2);
      
      uicontrol('Style','frame',...
         'Units','Normalized',...
         'Position',[0.03 0.03 0.94 0.94],...
         'BackGroundColor',[0.9 0.9 0.9]);
      
      uicontrol('Style','Pushbutton',...
         'Units','Normalized',...
         'Position',[0.1 0.75 0.8 .12],...
         'String','Specify new formants',...
         'Callback','new_formant');
      
      uicontrol('Style','pushbutton',...
         'Units','Normalized',...
         'Position',[0.1 0.60 0.8 .12],...
         'String','Load Formant file(mat)',...
         'Callback','load_formant');
      
      uicontrol('Style','Pushbutton',...
         'Units','Normalized',...
         'Position',[0.1 0.45 0.8 .12],...
         'String','Modify Specified formant',...
         'Callback','formant_modify');
      
      uicontrol('Style','Pushbutton',...
         'Units','Normalized',...
         'Position',[0.1 0.30 0.8 .12],...
         'String','Save Formants(mat)',...
         'Callback','formant_save');
      
      uicontrol('Style','Pushbutton',...
         'Units','Normalized',...
         'Position',[0.1  0.15 0.8 .12],...
         'String','Cancel',...
         'Callback','formant_quit');
   end
end

   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?