This project has moved. For the latest updates, please go here.

Determining total amount of samples

Dec 15, 2013 at 10:25 PM
Edited Dec 15, 2013 at 10:26 PM
I'm using VorbisReader to load a full decoded ogg file into memory (which I know is silly, but just hear me out). Is there a way to determine the total amount of samples that will be read by ReadSamples? I can estimate it by using something similar to:
int totalSamples = (vorbisReader.TotalTime.TotalSeconds + 1) * vorbisReader.SampleRate * vorbisReader.Channels;
But is there a more reliable way to do this, or should I just stick to having just a bit more space in my sample array than I actually need?

Dec 17, 2013 at 3:23 PM
In the current version, no. That said, you should be able to get really close with the calculation you are using.

When I get around to releasing v0.8, you'll be able to use the new TotalSamples property. :)
Jan 16, 2014 at 3:31 PM
The new release is up. Try the TotalSamples property. :)
Marked as answer by Villermen on 1/16/2014 at 12:03 PM
Jan 16, 2014 at 7:02 PM
Works perfectly, thanks! =)