cwindowswavgetopenfilename

How to get a WAV file duration in C?


I'm writing a WAV Player in C with SIGIL API and windows.h library, I'm using GetOpenFileName from the windows.h library to open the file, and I need a way to the program "read" the duration of the WAV file, there is some function to do so?


Solution

  • As far as I know:

    Time = [Size of file]/[Byte rate]

    You may also have some more factors:

    This information should be in the header.