How to extract data corresponding to definite time intervals from a .wav file?
I have been given a few .wav files and asked to separate the header and data. From the obtained data, samples corresponding to every 160-microseconds should be separated and copied to buffers.
I have now separated the header and got the following information:
Channels: 2,
Frames: 632956
Sample Rate: 44100,
Block Align: 4
Valid Bits: 16,
Bytes per sample: 2
For separating samples corresponding to every 160-microseconds, I am not able to calculate. I tried the following way:
Total bits per 160-microsecond = ((sampling_rate * bit depth) / (time))
= ((44100 * 16) / (160 * 1000000)) = 0.00441 bits.
I am sure that there is a mistake in the above calculation since there exist 44100 samples per second and hence for 160-microseconds there should exist bits count which is a positive natural number and cannot be a decimal value.
Can someone help with this calculation? Thanks.