I am trying to write a program to display PCM data. I am very upset trying to find a library with the right level of abstraction, but I found the python wave library and used this. However, I am not sure how to interpret the data.
The wave.getparams function returns (2 channels, 2 bytes, 44100 Hz, 96333 frames, No compression, No compression). It all seems funny, but then I tried to print one frame: '\ xc0 \ xff \ xd0 \ xff', which is 4 bytes. I believe that it is possible that the frame is 2 samples, but the uncertainties do not end there.
96333 frames * 2 counts / frame * (1 / 44.1k s / sample) = 4.3688 seconds
However, iTunes reports the time as close to 2 seconds as possible, and calculations based on file size and bitrate are in a step of 2.7 seconds. What's going on here?
Also, how do I know if bytes are signed or not?
Many thanks!
Sapphire sun
source share