Hi I want to read a wave file by a push button and save as it with other 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');
Best Answer