I need to produce a number of consistent music samples. Having 1 second long wave with sample rate 44100, I should be able to get an array of exactly 44100 samples. Unfortunatelly, this is not true.
My approach is the following:
1) Produce output.wav, which is 1 second long with sample rate 44100
avconv -i input.mp3 -ss 00:01:00 -t 00:00:01 -ar 44100 -ac 1 output.wav
2) I read the file and print the number of samples
meta,song = scipy.io.wavfile.read(path + "/" +file)
assert meta == 44100
print(len(song))
For different choices of input.mp3 and starting position I get different numbers: 43776, 43776, 44928, 43776, 43776, 44928
My question is, why is that the case? and how can I change the step 1, to produce consistent data samples?