Reputation: 39
I load an audio file and get sample
and sampleRate
with
[sample, sampleRate] = audioread(audiofile);
I want to get the length of the audio in seconds, how do I proceed?
Upvotes: 0
Views: 442
Reputation: 899
Having the sampleRate, the inverse of it is the sampling time.
Ts=1/sampleRate;
So the time vector for your sampled data would be
time=(0:(length(sample)-1))*Ts;
Upvotes: 2