How can I determine the length (i.e. duration) of a .wav file in C#?

Download NAudio.dll
from the link
https://www.dll-files.com/naudio.dll.html

and then use this function

public static TimeSpan GetWavFileDuration(string fileName)       
{     
    WaveFileReader wf = new WaveFileReader(fileName);
    return wf.TotalTime; 
}

you will get the Duration

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)