tyiannak / pyAudioAnalysis

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Apache License 2.0
5.88k stars 1.2k forks source link

silenceRemoval: x and y must have same first dimension, but have shapes (6435L,) and (6434L,) #83

Open kaiubiferreira opened 7 years ago

kaiubiferreira commented 7 years ago

I found an issue when trying to plot the results of the silenceRemoval onsets.

It is actually an issue on the numpy.arange funcion, which returns an array larger than the expected for the x axis.

I solved it by changing the line plt.plot(numpy.arange(0, ProbOnset.shape[0] stStep, stStep), ProbOnset) to plt.plot(numpy.arange(0, ProbOnset.shape[0] stStep, stStep)[0 : len(ProbOnset)], ProbOnset)

Reference: stop : number End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out. https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.arange.html

bagustris commented 5 years ago

Same error here, should be incorporated to the latest code as I install through pip.