Problem in using audiowrite function
22 ビュー (過去 30 日間)
古いコメントを表示
hi, i want to make matlab song
here is the code :
b=sin(2*pi*493.88*(0:0.000125:0.5));
d=sin(2*pi*587.33*(0:0.000125:0.5));
d=sin(2*pi*587.33*(0:0.000125:0.5));
f=sin(2*pi*698.45*(0:0.000125:0.5));
c=sin(2*pi*554.37*(0:0.000125:0.5));
e=sin(2*pi*659.26*(0:0.000125:0.5));
line1=[b,d,d];
line2=[d,d,c,c,b,b];
line3=[e,e,d,d,c,c,b,b];
song=[line1,line2,line3,line3,line1,line2];
audiowrite('Epi.wav',song,Fs);
[x,Fs] = audioread('Epi.wav');
sound(x);
but it show an error at line audiowrite('Epi.wav');
how can i fix it?
0 件のコメント
回答 (2 件)
Mehmed Saad
2020 年 4 月 17 日
編集済み: Mehmed Saad
2020 年 4 月 17 日
Define sampling Rate
Fs = 1/0.000125;
t = (0:1/Fs:0.5);
b=sin(2*pi*493.88*t);
d=sin(2*pi*587.33*t);
d=sin(2*pi*587.33*t);
f=sin(2*pi*698.45*t);
c=sin(2*pi*554.37*t);
e=sin(2*pi*659.26*t);
line1=[b,d,d];
line2=[d,d,c,c,b,b];
line3=[e,e,d,d,c,c,b,b];
song=[line1,line2,line3,line3,line1,line2];
audiowrite('Epi.wav',song,Fs);
[x,Fs] = audioread('Epi.wav');
sound(x,Fs)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Audio I/O and Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!