Windows natively supports duration for mp3 and wav since Windows 7 and many other audio types in 10. Just ask Windows:

[VB6, Vista+] A compact function to retrieve any property by name, locally formatted

Duration = GetPropertyDisplayString("C:\path\to\file.mp3", "System.Media.Duration")

Returns it already formatted in hh:mm:ss