function varargout = hdm_player(varargin)
% HDM_PLAYER MATLAB code for hdm_player.fig
% HDM_PLAYER, by itself, creates a new HDM_PLAYER or raises the existing
% singleton*.
%
% H = HDM_PLAYER returns the handle to a new HDM_PLAYER or the handle to
% the existing singleton*.
%
% HDM_PLAYER('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in HDM_PLAYER.M with the given input arguments.
%
% HDM_PLAYER('Property','Value',...) creates a new HDM_PLAYER or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before hdm_player_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to hdm_player_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 hdm_player
% Last Modified by GUIDE v2.5 08-Jun-2013 07:56:33
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @hdm_player_OpeningFcn, ...
'gui_OutputFcn', @hdm_player_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 hdm_player is made visible.
function hdm_player_OpeningFcn(hObject, eventdata, handles, varargin)
global T_obj which_channel T_start x;
which_channel = 1;
T_start = 0;
x = 0;
% 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 hdm_player (see VARARGIN)
T_obj=timer('TimerFcn',{@plotupdate, handles}, 'Period', 0.1, 'ExecutionMode', 'FixedRate');
% Choose default command line output for hdm_player
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes hdm_player wait for user response (see UIRESUME)
% uiwait(handles.figure1);
set(gcf, 'color','w')
% --- Outputs from this function are returned to the command line.
function varargout = hdm_player_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 loadbutton.
function loadbutton_Callback(hObject, eventdata, handles)
global wavfile Fs;
% hObject handle to loadbutton (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', '选择播放文件');
[wavfile Fs] = wavread([pathname filename]);
%sound(wavfile,Fs);
% --- Executes on button press in playbutton.
function playbutton_Callback(hObject, eventdata, handles)
global p wavfile Fs T_obj T_start x;
% hObject handle to playbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x = wavfile(:, 1);
p = audioplayer(x, Fs);
play(p);
if T_start == 0
start(T_obj);
T_start = 1;
end
% --- Executes on button press in pausebutton.
function pausebutton_Callback(hObject, eventdata, handles)
global p T_obj;
% hObject handle to pausebutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
pause(p);
% --- Executes on button press in continued.
function continued_Callback(hObject, eventdata, handles)
global p;
% hObject handle to continued (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
resume(p);
% --- Executes on button press in stopbutton.
function stopbutton_Callback(hObject, eventdata, handles)
global p T_obj T_stop;
% hObject handle to stopbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
stop(p);
stop(T_obj);
delete(T_obj);
T_stop = 1;
% --- Executes during object deletion, before destroying properties.
function figure1_DeleteFcn(hObject, eventdata, handles)
global T_obj T_stop p;
stop(p);
if T_stop == 0
stop(T_obj);
delete(T_obj);
end
% hObject handle to figure1 (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 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)
shg
set(gcf,'doublebuf','on','color','w','name','Walker','numbertitle','off')
set(gca,'pos',get(gca,'pos')+[0 .07 0 0])
% The body is represented by 15 points in three space, i.e. a vector of
% length 45. The data consists of F, five vectors describing the average
% female and M, five vectors describing the average male. Four linked
% segments, indexed by L, are the head, torso, arms, and legs.
% Initial view
load walkers
X = reshape((F(:,1)+M(:,1))/2,15,3);
L = {[1 5],[5 12],[2 3 4 5 6 7 8],[9 10 11 12 13 14 15]};
for k = 1:4
p(k) = line(X(L{k},1),X(L{k},2),X(L{k},3),'marker','o', ...
'markersize',10,'linestyle','-','erasemode','background');
end
set(p(1),'tag','head','userdata',zeros(1,3));
axis([-750 750 -750 750 0 1500])
set(gca,'xtick',[],'ytick',[],'ztick',[])
view(160,10)
% Sliders and controls
labels = {'speed','stride','sway','hop','bounce','gender'};
for j = 1:6
switch j
case 1, smin = 0; start = 1; smax = 3;
case 6, smin = -3; start = 0; smax = 3;
otherwise, smin = -2; start = 1; smax = 2;
end
txt = uicontrol('style','text','string',sprintf('%4.2f',start), ...
'back','w','units','norm','pos',[.16*j-.10 .11 .08 .03]);
sliders(j) = uicontrol('style','slider','units','norm','back','w', ...
'pos',[.16*j-.13 .07 .14 .03],'min',smin,'max',smax,'val',start, ...
'sliderstep',[1/(4*smax),1/(10*smax)],'userdata',txt,'callback',...
'set(get(gco,''userd''),''str'',sprintf(''%4.2f'',get(gco,''val'')))');
uicontrol('style','text','string',labels{j},'back','w', ...
'units','norm','pos',[.16*j-.12 .02 .10 .04])
end
cameratoolbar
stop = uicontrol('style','toggle','units','norm','pos',[.91 .94 .08 .05], ...
'backgr','w','fontw','bold','string','stop');
uicontrol('style','text','units','norm','pos',[.00 .92 .25 .06], ...
'backgr','w','fontangle','italic','string', ...
{'Change the view','with the mouse'})
uicontrol('style','radio','units','norm','pos',[.94 .90 .03 .03], ...
'userdata',H,'background','white', ...
'callback',['p1 = findobj(''tag'',''head''); if get(gco,''val''),' ...
'set(p1,''userd'',get(gco,''userd''),''marker'',''none''),' ...
'else, set(p1,''userd'',zeros(1,3),''marker'',''o''), end']);
% Start walkin'...
period = 151.5751;
omega = 2*pi/period;
t = 0;
while get(stop,'value') == 0
s = cell2mat(get(sliders,'value'));
t = t + s(1);
c = [sin(omega*t); cos(omega*t); sin(2*o
没有合适的资源?快使用搜索试试~ 我知道了~
音乐播放基于matlab GUI动感音乐播放【含Matlab源码 778期】.zip
共5个文件
jpg:1个
fig:1个
m:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 2 浏览量
2021-10-11
18:01:16
上传
评论 1
收藏 36.91MB ZIP 举报
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:hdm_player.m; Fig:GUI操作界面; 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到 Matlab的当前文件夹中; 步骤二:双击打开 hdm_player.m文件;(若有其他m文件,无需运行) 步骤三:点击运行,等程序运行完得到结果; 4、语音处理系列仿真咨询 如需其他服务,可私信博主或扫描博主博客文章底部QQ名片; 4.1 CSDN博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 语音处理系列程序定制或科研合作方向:语音隐藏、语音压缩、语音识别、语音去噪、语音评价、语音加密、语音合成、语音分析、语音分离、语音处理、语音编码、音乐检索、特征提取、声源定位、情感识别、语音采集播放变速等;
资源推荐
资源详情
资源评论
收起资源包目录
【音乐播放】基于matlab GUI动感音乐播放【含Matlab源码 778期】.zip (5个子文件)
【音乐播放】基于matlab GUI动感音乐播放【含Matlab源码 778期】
运行结果.JPG 97KB
walkers.mat 9KB
江语晨 - 我的主题曲.wav 38.7MB
hdm_player.m 10KB
hdm_player.fig 4KB
共 5 条
- 1
资源评论
- AYASAKA2022-01-01用户下载后在一定时间内未进行评价,系统默认好评。
海神之光
- 粉丝: 3w+
- 资源: 2066
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功