I have old code wavread and want to replace with audioread

30 views (last 30 days)
wavread doc function :
[...] = wavread('filename', N) returns only the first N samples from each channel in the file.
but in audioread doc function :
audioread(filename,samples) reads the selected range of audio samples in the file, where samples is a vector of the form [start,finish].
now how can I add N into audioread? My code is:
if true
signal_size=16000*10;
S(:,1)=wavread('all_sentences_train_DR1_MKLS0_M.wav',signal_size);
then
signal_size=16000*10;
S(:,1)=audioread('all_sentences_train_DR1_MKLS0_M.wav',signal_size);
end

Accepted Answer

Stephen23
Stephen23 on 16 Jun 2018
audioread('all_sentences_train_DR1_MKLS0_M.wav',[1,signal_size]);

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!