function varargout = guzheng(varargin)
% GUZHENG MATLAB code for guzheng.fig
% GUZHENG, by itself, creates a new GUZHENG or raises the existing
% singleton*.
%
% H = GUZHENG returns the handle to a new GUZHENG or the handle to
% the existing singleton*.
%
% GUZHENG('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUZHENG.M with the given input arguments.
%
% GUZHENG('Property','Value',...) creates a new GUZHENG or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before guzheng_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to guzheng_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 guzheng
% Last Modified by GUIDE v2.5 09-Nov-2020 23:51:14
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @guzheng_OpeningFcn, ...
'gui_OutputFcn', @guzheng_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 guzheng is made visible.
function guzheng_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 guzheng (see VARARGIN)
% Choose default command line output for guzheng
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes guzheng wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = guzheng_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global temp;
global Fs;
[temp,Fs]=audioread('D:\FILE\guiguzheng\gou.wav');
sound(temp,Fs);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global temp;
global Fs;
[temp,Fs]=audioread('D:\FILE\guiguzheng\chanyin.wav');
sound(temp,Fs);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global temp;
global Fs;
[temp,Fs]=audioread('D:\FILE\guiguzheng\shanghua.wav');
sound(temp,Fs);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global temp;
global Fs;
[temp,Fs]=audioread('D:\FILE\guiguzheng\xiahua.wav');
sound(temp,Fs);
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global temp;
global Fs;
[temp,Fs]=audioread('D:\FILE\guiguzheng\fanyin.wav');
sound(temp,Fs);
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global temp;
global Fs;
[temp,Fs]=audioread('D:\FILE\guiguzheng\yaozhi.wav');
sound(temp,Fs);
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename,pathname] = uigetfile('*.wav','选择音频文件'); %打开文件夹操作
path = [pathname,filename]; %路径
set(handles.show_path,'string',path);%将路径显示在tag为show_path的可编辑文本中
str=[pathname filename]; %选择的声音文件路径和文件名
delete('D:\openSMILE\bin\Win32\tz.bat');
delete('D:\FILE\guiguzheng\调用weka\shili.csv');
DirSource = pathname;
DirOut = 'D:\FILE\guiguzheng\调用weka\';
DS = DirSource;
DO = DirOut;
F = fopen('D:\openSMILE\bin\Win32\tz.bat','w');
fName = filename;
fprintf(F, '%s', 'SMILExtract_Release.exe -C D:\openSMILE\config\IS09_emotion.conf -I ');
fprintf(F, '%s ', [DS, fName], ' -O ');
fprintf(F, '%s\n', [DO,'shili', '.csv']);
fclose(F);
dos('D:\openSMILE\bin\Win32\tz.bat');
%str=[pathname filename];
run('D:\FILE\guiguzheng\调用weka\xiugai.m')
global temp;
global Fs;
[temp,Fs]=audioread(str);%temp表示声音数据 Fs表示频率
handles.y=temp;handles.Fs=Fs;
sound(temp,Fs);%播放音频文件
%plot(handles.axes1,temp);
%xlabel(handles.axes1,'时间');
%ylabel(handles.axes1,'幅值');
%global hAxes1 hAxes2
L = length(temp);
tt = (1:L)/Fs;
axes(handles.axes1);
plot(tt, temp);
% plot(handles.axes1,temp);
grid on;
xlabel(handles.axes1,'时间(s)');
ylabel(handles.axes1,'幅值');
axes(handles.axes2);
S = spectrogram(temp,4096,3072, 4096,Fs);
S = log(abs(S));
df1 = Fs/(2*size(S,1));
ff = df1:df1:Fs/2;
L = length(temp)/Fs;
dt1 = L/size(S,2);
tt2 = dt1:dt1:L;
mesh(tt2,ff,S);
view(0,90);
T = tt2(end);
axis([0 T 0 4000]);
xlabel('时间(s)');
ylabel('频率(Hz)');
function show_path_Callback(hObject, eventdata, handles)
% hObject handle to show_path (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 show_path as text
% str2double(get(hObject,'String')) returns contents of show_path as a double
% --- Executes during object creation, after setting all properties.
function show_path_CreateFcn(hObject, eventdata, handles)
% hObject handle to show_path (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
function shuchu_Callback(hObject, eventdata, handles)
% hObject handle to shuchu (see GCBO)
% eventdata
调用weka_MATLABWEKA_源码
版权申诉
37 浏览量
2021-10-04
00:29:09
上传
评论
收藏 18.78MB RAR 举报
爱牛仕
- 粉丝: 93
- 资源: 4716
最新资源
- 使用 C 语言实现的计算非负整数的阶乘
- 2011-2021最新版本北京大学数字普惠金融指数(PKU-DFIIC).xlsx
- 县域数字乡村指数2018-2020(1).xlsx
- Docker容器配置进阶
- tensorflow-gpu-2.7.4-cp37-cp37m-manylinux2010-x86-64.whl
- 多段线、 圆、弧转多段线(仅我可见)
- tensorflow-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- 李慧琴C语言基础部分.zip
- yeyue-p8Yi4-ve4a83792.apk
- tensorflow-gpu-2.7.3-cp38-cp38-manylinux2010-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0