I'm using NAudio library in a C# application. I'm trying to seek an audio (*.mp3 file) to the position I want. However I didn't figure out how to do it.
//Play the file starting from 16th second
waveStream.Seek(16, SeekOrigin.Begin);
And ... It played starting almost from the beginning, but not from the 16th second. I also found a solution I thought true:
waveStream.Seek(waveStream.WaveFormat.AverageBytesPerSecond * 16, SeekOrigin.Begin);
It seems it's closer the truth. Is my resolving true or not? If not what should I do?
ISampleProvider
’s extension methodSkip()
(that should take the sameTimeSpan
) doesn’t work, but this calculation approach does. Thanks! – Assent