Combine Wavread and Browse Filepath Using Gui ?
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm trying to apply wavread function, but i want a dynamic input from user so i use two button 1 contains the wavread function, 1 contain the browse filepath function.
function pushbutton1_Callback(hObject, eventdata, handles)
Filename= get(handles.pushbutton2,'UserData');
f=wavread(Filename,'native');
function pushbutton2_Callback(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.wav','Select Audio File ');
set(handles.text4,'String',FileName)
myAudio = get(hObject,'String');
set(hObject,'UserData',myAudio );
I got error like : Cannot open file.
Can someone correct me please, am i deliver the wrong variable so it can't be opened?Sorry i'm new to GUI so made a noob error.
댓글 수: 0
채택된 답변
Jing
2013년 3월 28일
You're not include the full path to the file. You should store the full path instead of just the file name.
myAudio=fullfile(PathName, FileName);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!