length of audio sample

Illustration
God'sSon - 2022-12-16T10:33:05+00:00
Question: length of audio sample

hello!   I am trying to import an audio sample into matlab and get matlab to tell me the length of the sample. Please can someone help me with this ,

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

Just in case you got a wave file

[y, Fs, nbits] = wavread(filename) %load the wav
[m d] = wavfinfo(filename) %get the wav information

Another way to get the length in seconds is:

siz = wavread(filename,'size') %siz = [samples channels]
siz(1)/Fs %should give you the length in seconds

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!