MATLAB: Length of audio sample

audio

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 ,
cheers.

Best Answer

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