This project has moved and is read-only. For the latest updates, please go here.

locate the current float value of a wav according mainOutputStream.CurrentTime

Apr 25, 2014 at 1:58 PM
Hi,
I have read a wav file into waveStream usig new NAudio.Wave.WaveFileReader. After that, I convert the waveStream into float[] buffer.
Now I want to locate the float value of mainOutputStream.CurrentTime of the wav file. Can I know any method can retrieve it?
Let's say the mainOutputStream.CurrentTime is 00:01:08.9720000, can I calculate the float value of at cuurent time 00:01:08.9720000? Any code in Naudio can be used to do that?
Hope I describe clearly enough. Thanks a lot.
May 8, 2014 at 10:03 AM
well you know the sample rate, so there are (say) 44100 samples per second, and the channel count. So you can use those two numbers to work out the offset into your buffer where the sample for any given time is.