6

When readframes() is used in python, the online documention says sampling frequency is returned it looks it returns 2 bytes. I think there are 4 byte on each frame:

left = 2 bytes
right = 2 bytes

Do I have to check if it is mono or stereo and if it is stereo, read 2 frames at a time and if it is mono, read 1 frame at a time?

phihag
  • 278,196
  • 72
  • 453
  • 469
kim taeyun
  • 1,837
  • 2
  • 24
  • 49

1 Answers1

5

A wave file has:

Every time you do a Wave_read.getframes(N), you get N * sample_width * n_channels bytes.

So, if you read 2048 frames from a 44100Hz, 16-bit stereo file, you get 8192 bytes as a result.

tzot
  • 92,761
  • 29
  • 141
  • 204