A simple way to determine file duration


Apologies in advance, I’m a JUCE noob and have been creating some interesting apps. I am recording some audio as WAV. I would like to determine the duration in seconds (I can display time accordingly). I understand I could crack open the file and read the chunks and do some calculations. Is there a simple convenience method in the JUCE library to determine this? I was going through the WavAudioFormatReader but nothing ‘jumped out at me’

Of course, any pointers to sample code would be great!

Thanks in advance.


Hints: length in samples / sample rate




Thanks. Hints were perfect. I’m on my way! :smiley: