echonest/remix — pull request #17 by carmi (2013-01-04 06:27:35+00:00)
Title: Fixed bug in AudioData.add_at regarding mixing two audio_data files of differing numChannels

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
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.