NAudio.Wave.WaveOutEvent.GetPosition C# (CSharp) Method

GetPosition() public method

Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream - it calls directly into waveOutGetPosition)
public GetPosition ( ) : long
return long
        public long GetPosition()
        {
            lock (waveOutLock)
            {
                MmTime mmTime = new MmTime();
                mmTime.wType = MmTime.TIME_BYTES; // request results in bytes, TODO: perhaps make this a little more flexible and support the other types?
                MmException.Try(WaveInterop.waveOutGetPosition(hWaveOut, out mmTime, Marshal.SizeOf(mmTime)), "waveOutGetPosition");

                if (mmTime.wType != MmTime.TIME_BYTES)
                    throw new Exception(string.Format("waveOutGetPosition: wType -> Expected {0}, Received {1}", MmTime.TIME_BYTES, mmTime.wType));

                return mmTime.cb;
            }
        }