Consider the case in which you have two Audio files A and B. You wish to add file B to A twice, and different times.
Currently, add_at() may resample B so the numChannels match. However, this modifies the data object of B, but does not correctly also modify B's numChannels. So this leaves B in a state where it's data and numChannels are not congruent. I get an error like:
Traceback (most recent call last): File "song-test.py", line 13, in <module> base.add_at(3, sax) File "/usr/local/lib/python2.7/dist-packages/echonest/audio.py", line 432, in add_at another_audio_data.data = numpy.repeat(another_audio_data.data, self.numChannels).reshape(len(another_audio_data), self.numChannels) ValueError: total size of new array must be unchanged
Consider the case in which you have two Audio files A and B. You wish to add file B to A twice, and different times.
Currently, add_at() may resample B so the numChannels match. However, this modifies the data object of B, but does not correctly also modify B's numChannels. So this leaves B in a state where it's data and numChannels are not congruent. I get an error like:
Traceback (most recent call last): File "song-test.py", line 13, in <module> base.add_at(3, sax) File "/usr/local/lib/python2.7/dist-packages/echonest/audio.py", line 432, in add_at another_audio_data.data = numpy.repeat(another_audio_data.data, self.numChannels).reshape(len(another_audio_data), self.numChannels) ValueError: total size of new array must be unchanged
This pull request fixes this bug.