function varargout = layout(varargin)
% LAYOUT MATLAB code for layout.fig
% LAYOUT, by itself, creates a new LAYOUT or raises the existing
% singleton*.
%
% H = LAYOUT returns the handle to a new LAYOUT or the handle to
% the existing singleton*.
%
% LAYOUT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in LAYOUT.M with the given input arguments.
%
% LAYOUT('Property','Value',...) creates a new LAYOUT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before layout_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to layout_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 layout
% Last Modified by GUIDE v2.5 18-Apr-2018 19:11:27
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @layout_OpeningFcn, ...
'gui_OutputFcn', @layout_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 layout is made visible.
function layout_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 layout (see VARARGIN)
% Choose default command line output for layout
handles.output = hObject;
handles.Fs = 16000;
handles.nBit = 16;
handles.length= 3;
set(handles.edit_Fs,'string','16000');
set(handles.edit_nBit,'string','16');
set(handles.edit_length,'string','3');
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes layout wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = layout_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 edit_location_Callback(hObject, eventdata, handles)
% hObject handle to edit_location (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,'String') returns contents of edit_location as text
% str2double(get(hObject,'String')) returns contents of edit_location as a double
% --- Executes during object creation, after setting all properties.
function edit_location_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_location (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit 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 button press in btn_select.
function btn_select_Callback(hObject, eventdata, handles)
voiceLocation=uigetdir('/Users/chaikai/Desktop/final');
fileFolder = getFolderName(voiceLocation);
set(handles.edit_location,'string',voiceLocation);
[dataT,audionumber]=getTableData(voiceLocation);
set(handles.table,'Data',dataT);
disp(voiceLocation);
handles.voiceLocation = voiceLocation;
handles.fileFolder = fileFolder;
handles.audionumber=audionumber;
guidata(hObject,handles);
% --- Executes during object deletion, before destroying properties.
function table_DeleteFcn(hObject, eventdata, handles)
% hObject handle to table (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in btn_draw.
function btn_draw_Callback(hObject, eventdata, handles)
data = getAllMFCCData(handles.voiceLocation,handles.fileFolder);
group=getAllGroupData(handles.voiceLocation,handles.fileFolder,handles.audionumber);
save([handles.voiceLocation,'/data/MFCC.mat'],'data');
save([handles.voiceLocation,'/data/Y.mat'],'group');
% --- Executes on button press in btn_judge.
function btn_judge_Callback(hObject, eventdata, handles)
load([handles.voiceLocation,'/data/MFCC.mat']);
load([handles.voiceLocation,'/data/Y.mat']);
temp=getOneTrainData(handles.recData,handles.Fs);
index=findAnswer(data,group,temp);
result=handles.fileFolder(1,index);
set(handles.edit_ans,'string',result);
function edit_ans_Callback(hObject, eventdata, handles)
% hObject handle to edit_ans (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,'String') returns contents of edit_ans as text
% str2double(get(hObject,'String')) returns contents of edit_ans as a double
% --- Executes during object creation, after setting all properties.
function edit_ans_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_ans (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit 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 button press in btn_play.
function btn_play_Callback(hObject, eventdata, handles)
sound(handles.recData,handles.Fs,handles.nBit);
% --- Executes on button press in btn_offline.
function btn_offline_Callback(hObject, eventdata, handles)
[FileName,PathName,FilterIndex]=uigetfile('*.wav');
recSrc=[PathName,FileName];
[recData,fs]=audioread(recSrc);
recData=EndDetection(recData);
plot(recData);
handles.recSrc=recSrc;
handles.recData=recData;
guidata(hObject,handles);
% --- Executes on button press in btn_online.
function btn_online_Callback(hObject, eventdata, handles)
myRecorder=audiorecorder(handles.Fs,handles.nBit,1);
recordblocking(myRecorder,handles.length);
recData=getaudiodata(myRecorder);
handles.recData=recData;
plot(recData);
guidata(hObject,handles);
function edit_Fs_Callback(hObject, eventdata, handles)
% hObject handle to edit_Fs (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,'String') returns contents of edit_Fs as text
% str2double(get(hObject,'String')) returns contents of edit_Fs as a double
% --- Executes during object creation, after setting all properties.
function edit_Fs_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_Fs (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
识别说话人的性别和估计说话人的年龄 Matlab+MatlabGUI+SVM源码.zip (19个子文件)
code
getFolderName.m 386B
addWindow.m 229B
toOneDim.m 413B
Pre_emphasis.m 161B
getAllGroupData.m 395B
audiocut.m 142B
average_energy.m 191B
getAllAudioOfFoler.m 381B
findAnswer.m 657B
layout.fig 37KB
getOneTrainData.m 380B
test1.m 576B
getTableData.m 499B
test.m 329B
EndDetection.m 4KB
layout.m 10KB
MFCC2par.m 1KB
getAllMFCCData.m 531B
fra.m 277B
共 19 条
- 1
资源评论
- 2301_769759832024-05-13感谢大佬,让我及时解决了当下的问题,解燃眉之急,必须支持!
FL1768317420
- 粉丝: 3775
- 资源: 4441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功