|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
% K' N5 x. }' o% Q4 ?. {$ ^( j: U( t一、简介6 X5 D- C0 G/ [9 R' w
基于matlab GUI界面处理录音与音频
) f4 `7 J& b# P
- X! s. B8 |) V; D0 x6 ?( B二、源代码' C; r" j( Q" ?5 w0 {! `
- function varargout = sigany(varargin)
- % SIGANY M-file for sigany.fig
- % SIGANY, by itself, creates a new SIGANY or raises the existing
- % singleton*.
- %
- % H = SIGANY returns the handle to a new SIGANY or the handle to
- % the existing singleton*.
- %
- % SIGANY('CALLBACK',hObject,eventData,handles,...) calls the local
- % function named CALLBACK in SIGANY.M with the given input arguments.
- %
- % SIGANY('Property','Value',...) creates a new SIGANY or raises the
- % existing singleton*. Starting from the left, property value pairs are
- % applied to the GUI before sigany_OpeningFunction gets called. An
- % unrecognized property name or invalid value makes property application
- % stop. All inputs are passed to sigany_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
- % Copyright 2002-2003 The MathWorks, Inc.
- % Edit the above text to modify the response to help sigany
- % Last Modified by GUIDE v2.5 14-May-2008 18:52:43
- % Begin initialization code - DO NOT EDIT
- gui_Singleton = 1;
- gui_State = struct('gui_Name', mfilename, ...
- 'gui_Singleton', gui_Singleton, ...
- 'gui_OpeningFcn', @sigany_OpeningFcn, ...
- 'gui_OutputFcn', @sigany_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 sigany is made visible.
- function sigany_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 sigany (see VARARGIN)
- hstartshow=figure;
- imshow('start.jpg');
- pause(3);
- % Choose default command line output for sigany
- handles.output = hObject;
- handles.time=str2double(get(handles.time,'String')); % ù±
- handles.sample=str2double(get(handles.sample,'String')); % ù
- handles.filename=get(handles.name,'String'); % ±
- axes(handles.axes1); %
- set(gcf,'doublebuffer','on') %Reduce plot flicker
- P = plot(zeros(1000,1)); % ú
- xlabel('Samples'), axis([0 1000 -1 1]), grid on
- title('采样数据实时波形');
- handles.P=P; % ±±ú
- handles.data=[]; % ó
- AI = analoginput('winsound'); % ù¨è±
- addchannel(AI,1); % íù
- handles.AI=AI; % ±ù¨è±
- % Update handles structure
- guidata(hObject, handles);
- % UIWAIT makes sigany wait for user response (see UIRESUME)
- % uiwait(handles.figure1);
- close(hstartshow);
6 {: ^: L9 M2 G. Q2 \ / O L: T% ?) G! m4 c6 @5 r
2 d$ [- L8 }- X7 z- u三、运行结果
3 [" m1 L5 o d! t8 m* _& Q; F
5 p, s8 c, t2 }" B; b9 U# O1 v
; P7 K7 K/ @: Z, l2 l0 P
6 O* F! s9 J1 `4 ~8 K
1 _) E( ]) w& _+ T4 s; q1 C* F& W
( f+ z4 v& Z% o- c- _7 Q7 A
0 N6 s! D4 U7 S* u% l4 h. c* L# `- c2 U9 N0 c' F! c2 n% P
s7 z" Z' E0 @8 v0 r! x
|
|