1. matlab
读取与播放
load gong.mat;% y 42028x1 doublesoundsc(y);% 可调节其频率soundsc(y, 2*Fs);
读取 .wav 等音频:audioread()
也可通过数字的方式仿真出一段声音:
N=10000;s=zeros(N,1);for a=1:Ns(a)=tan(a); %*sin(-a/10); endFs=2000; %increase value to speed up the sound, decrease to slow it downsoundsc(s,Fs)