How can I read a .wav file and save it with other name by 2push buttons?
Ältere Kommentare anzeigen
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');
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Import and Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!