matlab 读取音频并显示波形

主要函数

  • audioread

代码

%%
tic
interval = 44100;
need_exist = false;
index = 1;
while ~need_exist
    try
        [x, fs] = audioread( '1.mp3' , [(index-1)*interval+1, index*interval ]);
    catch
        [x, fs] = audioread( '1.mp3' , [(index-1)*interval+1, inf ]);
        need_exist = true;
    end
    index = index + 1;
    plot(x)
    drawnow
%     pause(0.)
end
toc

你可能感兴趣的:(matlab相关)