I have a better solution for your problem, without any library. First read all the bytes from the file. (you can also use FileSteam to read the necessary bytes only if you wish)
byte[] allBytes = File.ReadAllBytes(filePath);
After you have received all the bytes from your file, you need to receive bits per second. This value is usually stored in bytes with indices 28-31.
int bitrate = BitConverter.ToInt32(new[] { allBytes[28], allBytes[29], allBytes[30], allBytes[31] }, 0) * 8;
Now you can already get the duration in seconds.
int duration = (allBytes.Length - 8) * 8 / bitrate;
source share