function varargout = exp1_gui(varargin)
% EXP1_GUI MATLAB code for exp1_gui_timer.fig
% EXP1_GUI, by itself, creates a new EXP1_GUI or raises the existing
% singleton*.
%
% H = EXP1_GUI returns the handle to a new EXP1_GUI or the handle to
% the existing singleton*.
%
% EXP1_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in EXP1_GUI.M with the given input arguments.
%
% EXP1_GUI('Property','Value',...) creates a new EXP1_GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before exp1_gui_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to exp1_gui_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help exp1_gui
% Last Modified by GUIDE v2.5 12-Jan-2022 11:05:09
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @exp1_gui_OpeningFcn, ...
'gui_OutputFcn', @exp1_gui_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before exp1_gui is made visible.
function exp1_gui_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to exp1_gui (see VARARGIN)
% Choose default command line output for exp1_gui
clc;
global PAUSE_FLAG
global STOP_FLAG
global INDEX
handles.output = hObject;
% Update handles structure
handles.file = 0;
handles.path = 0;
handles.show_flag = 1;%默认显示普通波形图
handles.channel_num = 2;%默认声道数为2
handles.varied = 1:2;
PAUSE_FLAG = 0;
STOP_FLAG = 0;
INDEX = 0;
guidata(hObject, handles);
%1个图像显示的情况
set(handles.axes_graph1,'visible','on');
set(handles.axes_graph2,'visible','on');
% set(handles.axes_graph1,'position',[5.5 11 92 30]);
set(handles.popupmenu_waveform,'Enable','inactive');
% UIWAIT makes exp1_gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = exp1_gui_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --------------------------------------------------------------------
function function1_Callback(hObject, eventdata, handles)
% hObject handle to function1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
%选择文件选项按钮
function choose_file_Callback(hObject, eventdata, handles)
% hObject handle to choose_file (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[handles.file,handles.path] = uigetfile('/Users/jianghongqi/Desktop/第六学期/语音信号处理/语音信号处理实验/实验一/语音素材/speech.wav','*.wav');
if handles.file == 0
return
end
[handles.y,handles.fs,handles.player]=process_data(handles);
guidata(hObject, handles);
% --------------------------------------------------------------------
%退出选项按钮
function exit_option_Callback(hObject, eventdata, handles)
% hObject handle to exit_option (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close
% --- Executes on slider movement.
%进度条功能
function slider_progress_bar_Callback(hObject, eventdata, handles)
% hObject handle to slider_progress_bar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
% --- Executes during object creation, after setting all properties.
function slider_progress_bar_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_progress_bar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on selection change in popupmenu_channel_choose.
%选择声道下拉框
function popupmenu_channel_choose_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_channel_choose (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_channel_choose contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu_channel_choose
%设置图
%set(handles.axes_graph1,'position',[5.5 11 92 30]);
%取值为当前的声道数
index = get(hObject,'Value');
index2 = handles.show_flag;
if index2 == 2 && index ~= 1
msgbox('李萨如图形只支持双声道','提示');
set(hObject,'Value',1);
return
end
if handles.total_channel_num == 2
if index == 1
handles.channel_num = 2;%双声道播放
handles.varied = 1:handles.channel_num;
else
handles.channel_num = 1;%选择一个声道播放
handles.varied = index-1;
end
else
handles.channel_num = 1;
handles.varied = 1;
end
handles.player = audioplayer(handles.y(:,handles.varied),handles.fs);
guidata(hObject, handles);
%选择波形图
if index2 == 1
%清除图形的显示
clean_graph(handles);
play_with_time1(handles,1:length(handles.y),handles.y)%这个函数里会读取声道数
else
%清除图形的显示
clean_graph(handles);
play_with_time3(handles,handles.y);
end
% --- Executes during object creation, after setting all properties.
function popupmenu_channel_choose_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu_channel_choose (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in popupmenu_waveform.
%选择波形下拉框
function popupmenu_waveform_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu_waveform (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GU
海神之光
- 粉丝: 5w+
- 资源: 6894
最新资源
- 基于树莓派与百度智能云的人脸识别打卡系统(Qt开发,含接口调用,可作毕设).zip
- 基于SpringBoot等技术的仓储服务管理系统+设计报告(含SSM、Redis等).zip
- 毕业设计基于SpringBoot和MySQL的小学生口算练习与测评系统+论文报告.zip
- 基于C++的机房资源预约管理系统源码+报告文档(课程设计团队项目).zip
- 基于python机器学习的猫狗识别分类项目源码(含源码、说明与论文).zip
- 基于联邦深度强化学习的无人驾驶决策控制系统(Python源码及说明).zip
- 2024新开发基于机器学习的Android恶意代码检测项目(含说明与源码).zip
- 基于 FISCOBCOS 与 Paillier 同态加密的匿名投票案例(含源码与说明).zip
- 毕业设计基于深度学习卷积神经网络的图像分类GUI界面项目(含源码与说明).zip
- 基于深度学习的Landsat影像分类算法及源码(含设计文档+项目说明).zip
- 期末课设基于机器学习的股票预测实战算法(含项目说明,含python源码).zip
- 毕设基于QT和sqlite3的大二背单词辅助系统开发(含完整源码+全部资料).zip
- 基于FPGA的简易神经网络加速器设计-最新开发(含源码及全部资料).zip
- 软件杯获奖作品-林业有害生物智能识别-(含全部参赛源码及资料).zip
- 2024毕设:基于YOLOv5与 PyQt5 的人脸表情识别系统(含源码与说明).zip
- 基于C++和QT的OSM地图数据解析与导航系统(含完整源码+设计报告).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈