Hi
I'm trying to read a wave file by a push button ,play it with otherones, and save as it with another push button with a new name, how can I do that?
I do this code but have get Error!
% --- Executes on button press in Openb.
function Openb_Callback(hObject, eventdata, handles)
% hObject handle to Openb (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global filename pathname y fs nbits;
[filename, pathname]=uigetfile('*.wav', 'Select a wave file');
[handles.y, fs, nbits] = wavread(fullfile(pathname, filename));
% --- Executes on button press in Saveb.
function Saveb_Callback(hObject, eventdata, handles)
% hObject handle to Saveb (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global filename pathname y fs nbits;
[filename pathname]=uiputfile('*.wave', 'Choose a name to save file');
wavwrtie(y,fs,nbits,'*.wav');
% --- Executes on button press in Playb.
function Playb_Callback(hObject, eventdata, handles)
% hObject handle to Playb (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global filename pathname y fs nbits;
p=audioplayer(y,fs);
play(p, [START STOP]);