Determine .wav file playtime

Hi all,

Could anyone tell me how to determine/calculate the playtime for a wav file in c / c++ ?

TIA,
Freddy

for short files you can spawn wave to play the wav file and catch sigchld

google.com/search?q=wav+file … +reference

edit:
koders.com/c/fidF900DCF83522 … 05D08.aspx
u probably can compute the play time in seconds as ((FileSize-HeadersSize)/BitsPerSample)/SampleRate

Hi,

Thanks for answering. But shouldn’t the playtime be:

Data_Size / ByteRate instead of:

((FileSize-HeadersSize)/BitsPerSample)/SampleRate

Cheers,
Freddy