Saving .wav file
이전 댓글 표시
Hi everyone, recently I designed a song maker using GUIDE and was required to simple music notes into the song maker. I tried to save the notes into a .wav file but was having problem as the notes keep replacing existing notes, thus only one latest note was successfully saved. May I know how to save few notes into a single .wav file? Attached is the code I wrote for the note 'A' the audiowrite function was used. Thanks in advance :)
% --- Executes on button press in A1.
function A1_Callback(hObject, eventdata, handles)
Fs=8000;
Ts=1/Fs;
t=[0:Ts:3];
F_A=440;
A=sin(2*pi*F_A*t);
sound(A,Fs);
filename = ('C:\Users\Song.wav');
audiowrite(filename,A,Fs);
clear A Fs
% hObject handle to A1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!